Http://hi.baidu.com/xiaohuizuan/blog/item/95355933bc3ab7fe14cecb3f.html
I made a website a few days ago. I used the thunder download function and found it online.CodeI sorted it out. Now I have shared it with you.
First, configure the information on the. ASPX page.
<SCRIPT runat = Server> Public String thunderencode (string code) {code = "AA" + code + "ZZ"; string encode = ""; byte [] bytes = encoding. getencoding (1, 54936 ). getbytes (CODE); try {encode = convert. tobase64string (bytes);} catch {encode = Code;} return "Thunder: //" + encode;} </SCRIPT>
<SCRIPT src = "http://pstatic.xunlei.com/js/webThunderDetect.js"> </SCRIPT> <a href = "#" thunderhref = "<% = thunderencode (" http: // change to your own link. rar ") %> "thunderpid =" 57029 "thundertype =" "thunderrestitle =" "onclick =" Return ondownloadclick_simple (this, 2, 4) "oncontextmenu =" thundernetwork_sethref (this) "> fast download for thunder </a> <br/> <asp: button id =" button1 "runat =" server "text =" button "onclick =" button#click1 "/>
Then fill in the. CS File
Protected void button1_click1 (Object sender, eventargs e) {response. contenttype = "application/X-zip-compressed"; response. addheader ("content-disposition", "attachment?filename=z.zip"); string filename = server. mappath ("download file path"); response. transmitfile (filename );
}