比如说csdn上的用户留言,随时更新的,数据量很大,我想把这些数据下载到本地,然后进行操作,但csdn的数据库不可能暴露给我,我用什么方法,可以把这些数据下载到本地?
解决方案 »
- 怎样在webbrowser中获得saveFileDialog 的下载文件路径
- 请问 IDataParameter[] 如何强制转换成SqlParameter[],如果可以,该怎么转换。请教大神。
- 文章发布的问题
- 关于分页的几个问题 简单的分页
- dropdownlist动态绑定后如何去除绑定的第一项
- C#在WEB程序中如何自动搜过出淘宝等网站上某商品的最低价格,用webBrowser,HttpWebRequest都遇到问题
- ASP.NET做的网站程序是不是要编译后再使用呀?
- 这个东西弄了好久,寻求帮助!(Table嵌套)
- ComponentOne
- 用ASP.NET如何统计在线人数
- static问题
- help,关于excel数据导入到sql server数据库的问题。
{
sMethod = sMethod.ToUpper();
sMethod = sMethod!="POST"?"GET":sMethod;
string res ="";
HttpWebRequest re =(HttpWebRequest)HttpWebRequest.Create(url);
re.CookieContainer = cook; // attach the cook object
re.Method = sMethod;
re.AllowAutoRedirect = bAutoRedirect;
re.UserAgent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; MyIE2; .NET CLR 1.1.4322)";
if(Public.Session.bUsePox) //利用代理
{
int Port = 80;
if(Public.IsInt(this.Session.PoxPort))
{
Port = Convert.ToInt32(this.Session.PoxPort);
}
WebProxy pox = new WebProxy(this.Session.PoxIp,Port);
pox = (WebProxy)re.Proxy;
}
//re.Referer="http://expert.csdn.net/Expert/topic/2839/2839298.xml?temp=.2714197";
//re.ClientCertificates = new System.Security.Cryptography.X509Certificates.X509CertificateCollection();
//re.ClientCertificates = System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile(); //re.Timeout = 2000;
re.Referer = url;
if (sMethod =="POST") // Post data to Server
{
re.ContentType="application/x-www-form-urlencoded";
Byte[] b = this.getByteFromString(Param,ecode);
re.ContentLength = b.Length;
try
{
Stream oSRe = re.GetRequestStream();
oSRe.Write(b,0,b.Length);
oSRe.Close();
oSRe = null;
}
catch(Exception )
{
re = null;
return "-1";
}
}
HttpWebResponse rep = null;
Stream oResponseStream = null;
StreamReader oSReader = null;
try
{
rep=(HttpWebResponse)re.GetResponse();
oResponseStream = rep.GetResponseStream();
oSReader = new StreamReader(oResponseStream,ecode);
res =oSReader.ReadToEnd();
}
catch (System.Net.WebException e)
{
//res ="-1";
res = e.ToString();
} if (rep!=null)
{
rep.Close();
rep = null;
}
if(oResponseStream!= null)
{
oResponseStream.Close();
oResponseStream = null;
}
if(oSReader!=null)
{
oSReader.Close();
oSReader = null;
}
re = null; return res;
}
{
getHTMLByUrlCook(string url,ref System.Net.CookieContainer cook,string sMethod,string Param,bool bAutoRedirect,System.Text.Encoding ecode)}
<html>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../all.css" type="text/css">
<link rel="stylesheet" href="../VIP.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="5" topmargin="0" marginwidth="0" marginheight="0" background="../images/bg00.gif">
<table width="75%" border="1" cellspacing="1" cellpadding="2" align="center" bordercolor="#CCCCCC">
<tr>
<td>
<div align="center"><b>姓名或公司名</b></div>
</td>
<td>
<div align="center"><b>统一号码</b></div>
</td>
</tr>
<tr>
<td>
<div align="center">需要下载的数据</div>
</td>
<td>
<div align="center">需要下载的数据</div>
</td>
</tr>
</table>
</body>
</html>