回答編集履歴
1
コード例のAPIを変更
answer
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
{
|
14
14
|
try
|
15
15
|
{
|
16
|
-
var responce = await client.GetStringAsync("
|
16
|
+
var responce = await client.GetStringAsync("https://api.ipify.org"); // ipifyのサービスを利用
|
17
17
|
Console.WriteLine(responce);
|
18
18
|
}
|
19
19
|
catch
|
@@ -32,7 +32,7 @@
|
|
32
32
|
// using System.Net.Http; を追加
|
33
33
|
public static class GlobalIPAddressGetter
|
34
34
|
{
|
35
|
-
private const string api = "
|
35
|
+
private const string api = "https://api.ipify.org";
|
36
36
|
|
37
37
|
private static readonly WeakReference<HttpClient> weakreference = new WeakReference<HttpClient>(null);
|
38
38
|
|