ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostUpdateSharp/HostUpdateSharp.cs
(Generate patch)

Comparing HostUpdateSharp/HostUpdateSharp.cs (file contents):
Revision 82 by Douglas Thrift, 2004-03-01T16:28:58-08:00 vs.
Revision 86 by Douglas Thrift, 2004-03-01T17:09:19-08:00

# Line 13 | Line 13 | public class HostUpdateSharp
13   {
14          public static void Main(string[] args)
15          {
16 <                StringBuilder host = new StringBuilder(Dns.GetHostName());
16 > #if _uname_
17 >                String os = "FreeBSD 4.9-STABLE i386";
18 > #else
19 >                OperatingSystem os = Environment.OSVersion;
20 > #endif
21 >                StringBuilder host = new StringBuilder("host=" + Dns.GetHostName());
22                  string url = "http://topsecret.douglasthrift.net/auth/hostupdate.cgi";
23  
24                  if (host.ToString().IndexOf('.') < 0)
# Line 21 | Line 26 | public class HostUpdateSharp
26                          host.Append(".local.douglasthrift.net");
27                  }
28  
29 +                Console.WriteLine(host);
30 +                Console.WriteLine(os);
31 +
32                  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
33  
34                  request.Accept = "text/plain";
35 <                request.AllowAutoRedirect = false;
35 >                request.ContentLength = host.Length;
36                  request.ContentType = "application/x-www-form-urlencoded";
37                  request.Credentials = new NetworkCredential("HostUpdate", "frell2003");
38 +                request.KeepAlive = false;
39                  request.Method = "POST";
40 +                request.PreAuthenticate = true;
41 +                request.UserAgent = "Host Update Sharp/1.0 (" + os + ")";
42          }
43   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines