获取微信服务器IP地址

原文链接:http://www.cnblogs.com/devinlee/p/4282521.html

扫下方二维码关注,测试效果

Delphi XE7 用indy开发微信公众平台(2)- 获取微信服务器IP地址

const

ServerIpUrl = 'https://api.weixin.qq.com/cgi-bin/getcallbackip?&access_token=%s';

procedure GetServerList(out List: TStringList; AccessToken: String);
var
  Url: string;
  J: TJSONObject;
  temp: String;
begin
  Url := Format(ServerIpUrl, [Access_Token]);
  J := TJSONObject.ParseJSONValue(GetMethod(Url, 1)) as TJSONObject;
  try
    if J.Count > 0 then
    begin
      temp := J.GetValue('ip_list').ToString;
      delete(temp, 1, 1);
      delete(temp, Length(temp), 1);
      List.DelimitedText := temp;
    end;
  finally
    J.Free;
  end;
end;

 

相关文章:

  • 2021-06-30
  • 2021-04-13
  • 2022-12-23
  • 2021-06-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-12-02
  • 2022-12-23
  • 2021-06-29
相关资源
相似解决方案