VB.NET 中的 HTTP GET [英] HTTP GET in VB.NET

查看:34
本文介绍了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 中:

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")

在 C# 中:

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

这篇关于VB.NET 中的 HTTP GET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆