读书人

怎么得到http://wbmlw.zmipcam.net/Ge

发布时间: 2012-12-19 14:13:15 作者: rapoo

如何得到http://wbmlw.zmipcam.net/Getip.asp返回的值呢?
如何得到http://wbmlw.zmipcam.net/Getip.asp返回的值呢?
[最优解释]


WebClient web = new WebClient();
string s = web.DownloadString("http://wbmlw.zmipcam.net/Getip.asp");

[其他解释]


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
///引用命名空间
using System.IO;
using System.Net;
using System.Text;

namespace WebApplication5
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}

protected void Button1_Click(object sender, EventArgs e)
{
WebClient web = new WebClient();
string s = web.DownloadString("http://wbmlw.zmipcam.net/Getip.asp");

Label1.Text = s;
}
}
}

读书人网 >asp.net

热点推荐