浏览器能够下载网盘的加密连接
迅雷能下
QQ下载也能下我的代码中应该怎么处理呢? 请问下流程是怎样的? 给代码最好, 说明思路也行, 在线等.

解决方案 »

  1.   

    这是我的代码片段, 实在是不知道怎么办了.
    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响应
    .
      

  2.   

    CSDN的人都有女朋友了吗?这写程序的黄金时间都在干啥?
      

  3.   

    你使用Live Http Headers插件或者HttpWatch查看下浏览器发送的请求都是哪些信息。另外,可以贴出url供别人测试
      

  4.   

    我把源代码和说明都写到代码里了.http://localhostr.com/file/HR3CTFo/DownloadFile.rar大哥, 帮帮我, 我都快吐血了.
      

  5.   

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

  6.   

    这样就可以下载第二个
    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");
      

  7.   

    哇哇哇, 太NB了, 哥, 你太NB了, 我服了.
      

  8.   

    本帖最后由 net_lover 于 2012-02-21 21:34:41 编辑