怎么下载网盘上的加密连接呢? 在线等, 1秒结贴. 第二贴 浏览器能够下载网盘的加密连接迅雷能下QQ下载也能下我的代码中应该怎么处理呢? 请问下流程是怎样的? 给代码最好, 说明思路也行, 在线等. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我的代码片段, 实在是不知道怎么办了.System.Net.HttpWebRequest Myrq = ( System.Net.HttpWebRequest )System.Net.HttpWebRequest.Create( strURL ); //从URL地址得到一个WEB请求 Myrq.Timeout = intTimeOut * 1000;Myrq.AllowAutoRedirect = true;Myrq.AllowWriteStreamBuffering = true;Myrq.KeepAlive = true;Myrq.SendChunked = true;Myrq.UnsafeAuthenticatedConnectionSharing = true;Myrq.UseDefaultCredentials = true;Myrq.PreAuthenticate = true;String refer = strURL.Substring( 0, strURL.LastIndexOf( "/" ) + 1 );Myrq.Referer = refer;Myrq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13";System.Net.HttpWebResponse myrp = ( System.Net.HttpWebResponse )Myrq.GetResponse(); //从WEB请求得到WEB响应. CSDN的人都有女朋友了吗?这写程序的黄金时间都在干啥? 你使用Live Http Headers插件或者HttpWatch查看下浏览器发送的请求都是哪些信息。另外,可以贴出url供别人测试 我把源代码和说明都写到代码里了.http://localhostr.com/file/HR3CTFo/DownloadFile.rar大哥, 帮帮我, 我都快吐血了. private void btnDownload_Click( object sender, EventArgs e ) { //dbank网盘的文件连接 //下载页面: http://dl.dbank.com/c0mcaiyxws string strDbankUrl = @"http://117.34.68.56/file/MDAwMDAwMDG92N9iwG9PSvvvjBe-iumlgNS5N-TOk2IqqZBtQwQSpg../f212a599ac277f464f28d17547811474295430/Club.cmz?key=AAABQE9Dn87ONqS6&p=&a=4353515-111.112.172.123&mode=download"; //everbox网盘的文件连接 //下载页面: http://www.everbox.com/f/DtTzbFqok99kW9kfzwbMuDD753 string strEverBoxUrl = @"http://io1.everbox.com/?c=FjfrNOW0s_Nm18IOUlQ9n5cCX2IP0zjIYLF9ofXMgYHo2xRD7qOIwsA=&s=4599162&t=application/octet-stream&n=Club.cmz&token=yCTgPU-Kl6bhhYY_aakQEhCTTUEBAQEASS5GTw=="; //保存本地的路径及文件名 string strLocalFileName = Application.StartupPath + "\\test.xxx"; /////下载everbox网盘中的资源, 成功 //if ( DownLoad( strEverBoxUrl, strLocalFileName ) ) // MessageBox.Show( "ok" ); //else // MessageBox.Show( "error" ); ///下载dbank网盘中的资源, 总是失败 if ( DownLoad( strDbankUrl, strLocalFileName ) ) MessageBox.Show( "ok" ); else MessageBox.Show( "error" );}#region DownLoadpublic bool DownLoad( string strURL, string strFilename ) { try { System.Net.HttpWebRequest Myrq = ( System.Net.HttpWebRequest )System.Net.HttpWebRequest.Create( strURL ); //从URL地址得到一个WEB请求 Myrq.Timeout = 10000; Myrq.AllowAutoRedirect = true; Myrq.AllowWriteStreamBuffering = true; Myrq.KeepAlive = true; Myrq.SendChunked = true; Myrq.UnsafeAuthenticatedConnectionSharing = true; Myrq.UseDefaultCredentials = true; Myrq.PreAuthenticate = true; //String refer = strURL.Substring( 0, strURL.LastIndexOf( "/" ) + 1 ); //Myrq.Referer = refer; //Myrq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"; System.Net.HttpWebResponse myrp = ( System.Net.HttpWebResponse )Myrq.GetResponse(); //从WEB请求得到WEB响应 long totalBytes = myrp.ContentLength; //从WEB响应得到总字节数 System.IO.Stream st = myrp.GetResponseStream(); //从WEB请求创建流(读) System.IO.Stream so = new System.IO.FileStream( strFilename, System.IO.FileMode.Create ); //创建文件流(写) long totalDownloadedByte = 0; //下载文件大小 byte[] by = new byte[ 1024 ]; int osize = st.Read( by, 0, ( int )by.Length ); //读流 while ( osize > 0 ) { totalDownloadedByte = osize + totalDownloadedByte; //更新文件大小 Application.DoEvents(); so.Write( by, 0, osize ); //写流 osize = st.Read( by, 0, ( int )by.Length ); //读流 } so.Flush(); so.Close(); //关闭流 st.Close(); //关闭流 return true; } catch { return false; }}#endregion 这样就可以下载第二个String strURL = "http://io1.everbox.com/?c=FjfrNOW0s_Nm18IOUlQ9n5cCX2IP0zjIYLF9ofXMgYHo2xRD7qOIwsA=&s=4599162&t=application/octet-stream&n=Club.cmz&token=yCTgPU-Kl6bhhYY_aakQEhCTTUEBAQEASS5GTw==";System.Net.HttpWebRequest Myrq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(strURL); //从URL地址得到一个WEB请求 Myrq.Timeout = 10000;Myrq.AllowAutoRedirect = true;//String refer = strURL.Substring( 0, strURL.LastIndexOf( "/" ) + 1 );//Myrq.Referer = refer;Myrq.UserAgent = "Mozilla/5.0 (Windows NT 5.2; rv:10.0.2) Gecko/20100101 Firefox/10.0.2";Myrq.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";Myrq.Headers.Add("Accept-Language","zh-cn,zh;q=0.5");Myrq.Headers.Add("Accept-Encoding","gzip, deflate");System.Net.HttpWebResponse myrp = (System.Net.HttpWebResponse)Myrq.GetResponse(); //从WEB请求得到WEB响应long totalBytes = myrp.ContentLength; //从WEB响应得到总字节数 System.IO.Stream st = myrp.GetResponseStream(); //从WEB请求创建流(读) String strFilename = "e:\\xx.xx";System.IO.Stream so = new System.IO.FileStream(strFilename, System.IO.FileMode.Create); //创建文件流(写) long totalDownloadedByte = 0; //下载文件大小 byte[] by = new byte[1024];int osize = st.Read(by, 0, (int)by.Length); //读流 while (osize > 0){ totalDownloadedByte = osize + totalDownloadedByte; //更新文件大小 Application.DoEvents(); so.Write(by, 0, osize); //写流 osize = st.Read(by, 0, (int)by.Length); //读流 }so.Flush();so.Close(); //关闭流st.Close(); //关闭流MessageBox.Show("OK"); 哇哇哇, 太NB了, 哥, 你太NB了, 我服了. 本帖最后由 net_lover 于 2012-02-21 21:34:41 编辑 RDLC 报表展示大数据的时候速度相当慢,请问有什么办法解决? 如何在代码中获取别人程序的参数(帮助)信息? 怎样在程序中控制Window Form程序是否显示命令行窗口? 树型结构不显示的问题 托盘提示信息的受控显示 ======HttpContext.User.Identity的问题===== 高手请进,一个编译错误,帮看盾,谢了! 如何修改VS2008下所拉出的控件的字体默认字体类型及字体大小 威客系统大家有感兴趣的吗? 高手请进!如何用C#做成一个安装软件?在线等,解决马上散分! c# n次方怎么表示 C#学习中,望大家指导哈
System.Net.HttpWebRequest Myrq = ( System.Net.HttpWebRequest )System.Net.HttpWebRequest.Create( strURL ); //从URL地址得到一个WEB请求
Myrq.Timeout = intTimeOut * 1000;
Myrq.AllowAutoRedirect = true;
Myrq.AllowWriteStreamBuffering = true;
Myrq.KeepAlive = true;
Myrq.SendChunked = true;
Myrq.UnsafeAuthenticatedConnectionSharing = true;
Myrq.UseDefaultCredentials = true;
Myrq.PreAuthenticate = true;
String refer = strURL.Substring( 0, strURL.LastIndexOf( "/" ) + 1 );
Myrq.Referer = refer;
Myrq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13";
System.Net.HttpWebResponse myrp = ( System.Net.HttpWebResponse )Myrq.GetResponse(); //从WEB请求得到WEB响应
.
//dbank网盘的文件连接
//下载页面: http://dl.dbank.com/c0mcaiyxws
string strDbankUrl = @"http://117.34.68.56/file/MDAwMDAwMDG92N9iwG9PSvvvjBe-iumlgNS5N-TOk2IqqZBtQwQSpg../f212a599ac277f464f28d17547811474295430/Club.cmz?key=AAABQE9Dn87ONqS6&p=&a=4353515-111.112.172.123&mode=download";
//everbox网盘的文件连接
//下载页面: http://www.everbox.com/f/DtTzbFqok99kW9kfzwbMuDD753
string strEverBoxUrl = @"http://io1.everbox.com/?c=FjfrNOW0s_Nm18IOUlQ9n5cCX2IP0zjIYLF9ofXMgYHo2xRD7qOIwsA=&s=4599162&t=application/octet-stream&n=Club.cmz&token=yCTgPU-Kl6bhhYY_aakQEhCTTUEBAQEASS5GTw==";
//保存本地的路径及文件名
string strLocalFileName = Application.StartupPath + "\\test.xxx";
/////下载everbox网盘中的资源, 成功
//if ( DownLoad( strEverBoxUrl, strLocalFileName ) )
// MessageBox.Show( "ok" );
//else
// MessageBox.Show( "error" ); ///下载dbank网盘中的资源, 总是失败
if ( DownLoad( strDbankUrl, strLocalFileName ) )
MessageBox.Show( "ok" );
else
MessageBox.Show( "error" );
}#region DownLoad
public bool DownLoad( string strURL, string strFilename ) {
try {
System.Net.HttpWebRequest Myrq = ( System.Net.HttpWebRequest )System.Net.HttpWebRequest.Create( strURL ); //从URL地址得到一个WEB请求
Myrq.Timeout = 10000;
Myrq.AllowAutoRedirect = true;
Myrq.AllowWriteStreamBuffering = true;
Myrq.KeepAlive = true;
Myrq.SendChunked = true;
Myrq.UnsafeAuthenticatedConnectionSharing = true;
Myrq.UseDefaultCredentials = true;
Myrq.PreAuthenticate = true;
//String refer = strURL.Substring( 0, strURL.LastIndexOf( "/" ) + 1 );
//Myrq.Referer = refer;
//Myrq.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; zh-CN; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13";
System.Net.HttpWebResponse myrp = ( System.Net.HttpWebResponse )Myrq.GetResponse(); //从WEB请求得到WEB响应 long totalBytes = myrp.ContentLength; //从WEB响应得到总字节数
System.IO.Stream st = myrp.GetResponseStream(); //从WEB请求创建流(读)
System.IO.Stream so = new System.IO.FileStream( strFilename, System.IO.FileMode.Create ); //创建文件流(写)
long totalDownloadedByte = 0; //下载文件大小
byte[] by = new byte[ 1024 ];
int osize = st.Read( by, 0, ( int )by.Length ); //读流
while ( osize > 0 ) {
totalDownloadedByte = osize + totalDownloadedByte; //更新文件大小
Application.DoEvents();
so.Write( by, 0, osize ); //写流
osize = st.Read( by, 0, ( int )by.Length ); //读流
}
so.Flush();
so.Close(); //关闭流
st.Close(); //关闭流
return true;
} catch {
return false;
}
}
#endregion
String strURL = "http://io1.everbox.com/?c=FjfrNOW0s_Nm18IOUlQ9n5cCX2IP0zjIYLF9ofXMgYHo2xRD7qOIwsA=&s=4599162&t=application/octet-stream&n=Club.cmz&token=yCTgPU-Kl6bhhYY_aakQEhCTTUEBAQEASS5GTw==";
System.Net.HttpWebRequest Myrq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create(strURL); //从URL地址得到一个WEB请求
Myrq.Timeout = 10000;
Myrq.AllowAutoRedirect = true;//String refer = strURL.Substring( 0, strURL.LastIndexOf( "/" ) + 1 );
//Myrq.Referer = refer;
Myrq.UserAgent = "Mozilla/5.0 (Windows NT 5.2; rv:10.0.2) Gecko/20100101 Firefox/10.0.2";
Myrq.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
Myrq.Headers.Add("Accept-Language","zh-cn,zh;q=0.5");
Myrq.Headers.Add("Accept-Encoding","gzip, deflate");System.Net.HttpWebResponse myrp = (System.Net.HttpWebResponse)Myrq.GetResponse(); //从WEB请求得到WEB响应long totalBytes = myrp.ContentLength; //从WEB响应得到总字节数
System.IO.Stream st = myrp.GetResponseStream(); //从WEB请求创建流(读)
String strFilename = "e:\\xx.xx";
System.IO.Stream so = new System.IO.FileStream(strFilename, System.IO.FileMode.Create); //创建文件流(写)
long totalDownloadedByte = 0; //下载文件大小
byte[] by = new byte[1024];
int osize = st.Read(by, 0, (int)by.Length); //读流
while (osize > 0)
{
totalDownloadedByte = osize + totalDownloadedByte; //更新文件大小
Application.DoEvents();
so.Write(by, 0, osize); //写流
osize = st.Read(by, 0, (int)by.Length); //读流
}
so.Flush();
so.Close(); //关闭流
st.Close(); //关闭流
MessageBox.Show("OK");