HTTP GET in VB.NET

后端 未结 7 648
离开以前
离开以前 2020-11-27 15:25

What is the best way to issue a http get in VB.net? I want to get the result of a request like http://api.hostip.info/?ip=68.180.206.184

7条回答
  •  时光说笑
    2020-11-27 16:18

    In VB.NET:

    Dim webClient As New System.Net.WebClient
    Dim result As String = webClient.DownloadString("http://api.hostip.info/?ip=68.180.206.184")
    

    In C#:

    System.Net.WebClient webClient = new System.Net.WebClient();
    string result = webClient.DownloadString("http://api.hostip.info/?ip=68.180.206.184");
    

提交回复
热议问题