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 76 by Douglas Thrift, 2004-02-28T00:34:19-08:00 vs.
Revision 83 by Douglas Thrift, 2004-03-01T16:47:47-08:00

# Line 1 | Line 1
1 < // Host Update Sharp
2 < //
3 < // Douglas Thrift
4 < //
5 < // $Id$
6 <
7 < using System;
8 < using System.IO;
9 < using System.Net;
10 <
11 < namespace DouglasThrift.HostUpdateSharp
12 < {
13 <        public class HostUpdateSharp
14 <        {
15 <                public static void Main(string[] args)
16 <                {
17 <                        //
18 <                }
19 <        }
20 < }
1 > // Host Update Sharp
2 > //
3 > // Douglas Thrift
4 > //
5 > // $Id$
6 >
7 > using System;
8 > using System.IO;
9 > using System.Net;
10 > using System.Text;
11 >
12 > public class HostUpdateSharp
13 > {
14 >        public static void Main(string[] args)
15 >        {
16 > #if !_FreeBSD_
17 >                String os = "FreeBSD";
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)
25 >                {
26 >                        host.Append(".local.douglasthrift.net");
27 >                }
28 >
29 >                Console.WriteLine(host);
30 >
31 >                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
32 >
33 >                request.Accept = "text/plain";
34 >                request.ContentLength = host.Length;
35 >                request.ContentType = "application/x-www-form-urlencoded";
36 >                request.Credentials = new NetworkCredential("HostUpdate", "frell2003");
37 >                request.KeepAlive = false;
38 >                request.Method = "POST";
39 >                request.PreAuthenticate = true;
40 >                request.UserAgent = "Host Update Sharp/1.0 (" + os + ")";
41 >        }
42 > }

Comparing HostUpdateSharp/HostUpdateSharp.cs (property svn:eol-style):
Revision 76 by Douglas Thrift, 2004-02-28T00:34:19-08:00 vs.
Revision 83 by Douglas Thrift, 2004-03-01T16:47:47-08:00

# Line 0 | Line 1
1 + native

Comparing HostUpdateSharp/HostUpdateSharp.cs (property svn:keywords):
Revision 76 by Douglas Thrift, 2004-02-28T00:34:19-08:00 vs.
Revision 83 by Douglas Thrift, 2004-03-01T16:47:47-08:00

# Line 0 | Line 1
1 + Id

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines