VB.NET中的HTTP GET

问题描述:

在VB.net中发布http get的最佳方法是什么?我想获取类似 http://api.hostip.info/?ip的请求的结果= 68.180.206.184

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

在VB.NET中:

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

在C#中:

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