8 |
|
using System.IO; |
9 |
|
using System.Net; |
10 |
|
using System.Text; |
11 |
– |
#if !_FreeBSD_ |
12 |
– |
using System.Windows.Forms; |
13 |
– |
#endif |
11 |
|
|
12 |
|
public class HostUpdateSharp |
13 |
|
{ |
14 |
|
public static void Main(string[] args) |
15 |
|
{ |
16 |
+ |
try |
17 |
+ |
{ |
18 |
+ |
new HostUpdateSharp(); |
19 |
+ |
} |
20 |
+ |
catch (Exception exception) { Console.Error.WriteLine(exception); } |
21 |
+ |
} |
22 |
+ |
public HostUpdateSharp() |
23 |
+ |
{ |
24 |
|
StringBuilder host = new StringBuilder("host=" + Dns.GetHostName()); |
25 |
|
string url = "http://topsecret.douglasthrift.net/auth/hostupdate.cgi"; |
26 |
|
|
52 |
|
Encoding.ASCII); |
53 |
|
|
54 |
|
Console.Write(content.ReadToEnd()); |
55 |
+ |
content.Close(); |
56 |
|
} |
57 |
|
#if _FreeBSD_ |
58 |
< |
private static string platform() { return "FreeBSD 4.9-STABLE i386"; } |
58 |
> |
private string platform() { return "FreeBSD 4.9-STABLE i386"; } |
59 |
|
#else |
60 |
< |
private static string platform() |
60 |
> |
private string platform() |
61 |
|
{ |
62 |
|
OperatingSystem os = Environment.OSVersion; |
63 |
|
string system = "Unknown"; |