8 |
|
using System.IO; |
9 |
|
using System.Net; |
10 |
|
using System.Text; |
11 |
+ |
#if !_FreeBSD_ |
12 |
+ |
using System.Windows.Forms; |
13 |
+ |
#endif |
14 |
|
|
15 |
|
public class HostUpdateSharp |
16 |
|
{ |
17 |
|
public static void Main(string[] args) |
18 |
|
{ |
19 |
+ |
foreach (string arg in args) |
20 |
+ |
{ |
21 |
+ |
switch (arg) |
22 |
+ |
{ |
23 |
+ |
case "-D": |
24 |
+ |
debug = true; |
25 |
+ |
break; |
26 |
+ |
} |
27 |
+ |
} |
28 |
+ |
|
29 |
|
try |
30 |
|
{ |
31 |
|
new HostUpdateSharp(); |
68 |
|
StreamReader content = new StreamReader(response.GetResponseStream(), |
69 |
|
Encoding.ASCII); |
70 |
|
|
71 |
< |
Console.Write(content.ReadToEnd()); |
71 |
> |
#if _FreeBSD_ |
72 |
> |
if (debug) Console.Write(content.ReadToEnd()); |
73 |
> |
#else |
74 |
> |
if (debug) MessageBox.Show(content.ReadToEnd(), "Host Update Sharp", |
75 |
> |
MessageBoxButtons.OK, MessageBoxIcon.Information); |
76 |
> |
#endif |
77 |
> |
|
78 |
|
content.Close(); |
79 |
|
} |
80 |
+ |
private static bool debug = false; |
81 |
|
#if _FreeBSD_ |
82 |
|
private string platform() { return "FreeBSD 4.9-STABLE i386"; } |
83 |
|
#else |