質問するログイン新規登録

回答編集履歴

1

コード例のAPIを変更

2016/10/04 06:15

投稿

tamoto
tamoto

スコア4366

answer CHANGED
@@ -13,7 +13,7 @@
13
13
  {
14
14
  try
15
15
  {
16
- var responce = await client.GetStringAsync("http://inet-ip.info/ip"); // inet-ip.info APIを利用
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 = "http://inet-ip.info/ip";
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