質問編集履歴
2
実際に使用してみたコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,3 +13,73 @@
|
|
13
13
|
- [http://blog.codebook-10000.com/entry/20131001/1380648141](http://blog.codebook-10000.com/entry/20131001/1380648141)
|
14
14
|
|
15
15
|
- [https://www.ipentec.com/document/document.aspx?page=csharp-http-get-web-using-web-client](https://www.ipentec.com/document/document.aspx?page=csharp-http-get-web-using-web-client)
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
実際に使用してみたコード
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
htmlファイルをダウンロードするやり方
|
24
|
+
|
25
|
+
```C#
|
26
|
+
|
27
|
+
private void Form1_Load(object sender, EventArgs e)
|
28
|
+
|
29
|
+
{
|
30
|
+
|
31
|
+
string outputHtml = @"C:\download.html";
|
32
|
+
|
33
|
+
StreamWriter writer = new StreamWriter(outputHtml);
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
WebClient client = new WebClient();
|
38
|
+
|
39
|
+
string str = client.DownloadString("https://pvp.minecraft.jp/servers");
|
40
|
+
|
41
|
+
writer.Write(str);
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
```
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
htmlのソースを直接表示させるやり方
|
50
|
+
|
51
|
+
```C#
|
52
|
+
|
53
|
+
private void Form1_Load(object sender, EventArgs e)
|
54
|
+
|
55
|
+
{
|
56
|
+
|
57
|
+
WebClient wc = new WebClient();
|
58
|
+
|
59
|
+
try
|
60
|
+
|
61
|
+
{
|
62
|
+
|
63
|
+
string text = wc.DownloadString("https://pvp.minecraft.jp/servers");
|
64
|
+
|
65
|
+
textBox1.Text += text;
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
catch (WebException exc)
|
70
|
+
|
71
|
+
{
|
72
|
+
|
73
|
+
textBox1.Text += exc.Message;
|
74
|
+
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
this.MaximizeBox = !this.MaximizeBox;
|
80
|
+
|
81
|
+
timer1.Start();
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
```
|
1
添付URLの説明変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
|
10
10
|
|
11
|
-
|
11
|
+
下のページに載っているコードを使いました。
|
12
12
|
|
13
13
|
- [http://blog.codebook-10000.com/entry/20131001/1380648141](http://blog.codebook-10000.com/entry/20131001/1380648141)
|
14
14
|
|