Asp.net实现迅雷下载

1首先实现下载地址转换为迅雷地址

    public string ThunderEncode(string code)
    {
        code = "AA" + code + "ZZ";
        string encode = "";
        byte[] bytes = Encoding.GetEncoding(54936).GetBytes(code);
        try
        {
            encode = Convert.ToBase64String(bytes);
        }
        catch
        {
            encode = code;
        }
        return "thunder://" + encode;
    }

2前台页面

<script src="http://pstatic.xunlei.com/js/webThunderDetect.js"></script>
<a href="#" thunderHref="<%=ThunderEncode("http://localhost:7723/WebSite9/attach/ServerDemo.tar")%>" thunderPid="57029" 
thunderType="" thunderResTitle="" onClick="return OnDownloadClick_Simple(this,2,4)" oncontextmenu="ThunderNetwork_SetHref(this)" >迅雷专用高速下载</a>

 



posted @ 2012-06-13 09:33  Johnny Yan  阅读(2287)  评论(0编辑  收藏  举报