网址
http://www.anttna.com/cell2gps/cell2gps.php?lac=4493&cellid=8473
http://www.anttna.com/cell2gps/cell2gps.php?lac=4493&cellid=8473
解决方案 »
- Access Update 为select值出错 操作必须使用一个可更新的语句
- 明天就要答辩了,这个问题还没解决,问老师也不知道我晕,急急急,在线等候!
- 新手請教一個調用存儲過程再輸出到表格裏的問題
- 求几个RegularExpressionValidator的正则表达式
- 一个员工表,我给Datagrid绑定,而我想让经理行(IsMaster = 1)的背景色设为红色
- 查询时数字及时间的数据类型不匹配。
- 请教:如何在一个项目中调用另一个项目的ascx
- 帮我看看这个错误~~~~~~~关于REPEATER
- 域名转向的问题(非常奇怪!)
- **如何连接局域网中一台win200 advance server的access数据库**
- 请教:关于远程域名授权的程序方法验证
- sql while语句怎么写
using System.Net;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
WebClient client = new WebClient();
byte[] bt = client.DownloadData("http://www.anttna.com/cell2gps/cell2gps.php?lac=4493&cellid=8473");
string s = System.Text.Encoding.GetEncoding("GB2312").GetString(bt);
Console.WriteLine(s);
}
}}
{
try
{
HttpWebRequest wr = WebRequest.Create(url) as HttpWebRequest;
wr.Method = "get";
wr.Accept = "*/*";
wr.Headers.Add("Accept-Language: zh-cn");
wr.Headers.Add("UA-CPU: x86");
wr.Headers.Add("Accept-Encoding: gzip, deflate");
wr.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Embedded Web Browser from: http://bsalsa.com/; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)";
wr.KeepAlive = true;
wr.ServicePoint.Expect100Continue = false;
wr.AllowAutoRedirect = false; HttpWebResponse wre = wr.GetResponse() as HttpWebResponse;
StreamReader sreader = new StreamReader(wre.GetResponseStream(), Encoding.UTF8);
string sHtml = sreader.ReadToEnd();
wre.Close();
return sHtml;
}
catch
{
return "";
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.IO;namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void button1_Click(object sender, EventArgs e)
{
WebClient client = new WebClient();
byte[] bt = client.DownloadData("http://www.anttna.com/cell2gps/cell2gps.php?lac=4493&cellid=8473");
string s = System.Text.Encoding.GetEncoding("GB2312").GetString(bt);
Console.WriteLine(s);
this.label1.Text = s;
}
public static string GetPageHTML(string url)
{ try
{
HttpWebRequest wr = WebRequest.Create(url) as HttpWebRequest;
wr.Method = "get";
wr.Accept = "*/*";
wr.Headers.Add("Accept-Language: zh-cn");
wr.Headers.Add("UA-CPU: x86");
wr.Headers.Add("Accept-Encoding: gzip, deflate");
wr.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Embedded Web Browser from: http://bsalsa.com/; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022)";
wr.KeepAlive = true;
wr.ServicePoint.Expect100Continue = false;
wr.AllowAutoRedirect = false; HttpWebResponse wre = wr.GetResponse() as HttpWebResponse;
StreamReader sreader = new StreamReader(wre.GetResponseStream(), Encoding.GetEncoding("GBK"));
string sHtml = sreader.ReadToEnd();
wre.Close();
return sHtml;
}
catch
{
return "";
}
} private void button2_Click(object sender, EventArgs e)
{
string a = GetPageHTML("http://www.anttna.com/cell2gps/cell2gps.php?lac=4493&cellid=8473");
this.label1.Text=a;
}
}
}