使用下载频道的朋友,一般都会选择快车或者迅雷下载,今天修改了下载频道代码,增加了下载地址判断,站外连接直接下载,站内资源则自动选择快车下载和迅雷下载。在此特别感谢雨哲提供的思路!
主要修改文件ShowSoftDown.asp,修改前建议自己做好备份:
1.在<!--#include file="CommonCode.asp"-->下面增加:
代码如下: <script src="http://ufile.kuaiche.com/Flashget_union.php?fg_uid=你申请的id"></script> <!--#include file="Flashget_base64.asp"--> <!--#include file="base64.asp"--> <script src="http://pstatic.xunlei.com/js/webThunderDetect.js"></script>
如需要添加快车搜索,还需添加:
<style type="text/css"> .skuaicheForm{margin:0px 0px 0px 0px;} /*--Form css--*/ .skuaicheImg{width:22px;height:22px;} /*--FlashgetLogo css--*/ .skuaicheInput{border:1px solid #CCCCCC;color:#7C7C7C;width:200px;height:22px;padding:3px
0px 0px 5px;border-left:none;}/*--searchText css--*/ .skuaicheButton{background:none;width:64px;height:22px;border:1px solid #CCCCCC;border-
left:none;padding:2px 0px 0px 2px;font-size:12px;color:#666666;cursor:pointer;}/*--
submitButton css--*/ </style> 2.在Response.CacheControl = "no-cache"下面添加
代码如下: '获取软件名称和ID Dim rs, SoftID, SoftName SoftID = Trim(request("SoftID")) Call openconn Set rs = Conn.Execute("select SoftName from PE_Soft where SoftID = " & SoftID & " ") SoftName = rs("SoftName") Set rs = Nothing Call closeconn '获取软件名称和ID
3.下面代码增加红色部分:
代码如下: Dim DownloadUrl, FileExt, flashgetUrl, thunderUrl, DownloadUrlLink DownloadUrlLink = "" DownloadUrl = PE_Soft.GetDownloadUrl() If DownloadUrl = "ErrorDownloadUrl" Then Response.End Set PE_Soft = Nothing FileExt = LCase(Mid(DownloadUrl, InStrRev(DownloadUrl, ".") + 1)) If InStr(DownloadUrl, "://") <= 0 Then DownloadUrl = "http://" & Trim(Request.ServerVariables("HTTP_HOST")) & DownloadUrl flashgetUrl = FlashgetEncode(DownloadUrl,1106) thunderUrl = ThunderEncode(DownloadUrl) Else DownloadUrlLink = "1" End If
4.再把下面代码
代码如下: '方法二可以使用“目标另存为”,但会有中文乱码问题 Response.Redirect DownloadUrl
改为 代码如下: '方法二可以使用“目标另存为”,但会有中文乱码问题 if DownloadUrlLink <> "" Then Response.Redirect DownloadUrl Else %> <div> <table height=80 cellSpacing=0 cellPadding=0 width=500 align=center border=0> <tr> <td></td> </tr> </table> <table class=Guest_border cellSpacing=1 cellPadding=0 width=500 align=center border=0> <tr> <td vAlign=top align=middle> <table bgcolor=#8EB4DB cellSpacing=0 cellPadding=0 width="100%" height=28 border=0> <tr> <TH><font color=#FFFFFF><%=SiteName%>—友情提示</font></TH> </tr> </table> </td> </tr> <tr> <td class=Guest_tdbg vAlign=top align=middle> <table height=15 cellSpacing=0 cellPadding=0 width="80%" border=0> <tr> <td></td> </tr> </table> <table height="100%" cellSpacing=0 cellPadding=0 width="80%" border=0> <tr> <td class=TableRow1 vAlign=center height=25> <LI>软件名称:<font color=#990000><%=SoftName%></font></LI></td> </tr> <tr> <td class=TableRow1 vAlign=center height=25> <LI>我要报错:如果您发现该软件不能下载,请点击【<A href="DownError.asp?
SoftID=<%=SoftID%>"><FONT color=red><B>报错</B></FONT></A>】!同时,本站强烈推荐您再搜搜看。
。。。。。</LI></td> </tr> <tr> <td class=TableRow1 vAlign=center height=25> <LI><FONT color=blue>快车高速下载:</FONT><a href="#" onClick="ConvertURL2FG
('<%=flashgetUrl%>','<%= DownloadUrl%>',1106)" fg="<%=flashgetUrl%>"
oncontextmenu="Flashget_SetHref(this)" ><%=SoftName%></a></LI></td> </tr>
<tr> <td class=TableRow1 vAlign=center Align=center> <script src="http://ufile.kuaiche.com/form.php?sid=你申请的ID&code=gb2312"
></script></td> </tr>
<tr> <td class=TableRow1 vAlign=center height=25> <LI><a href="http://download.it168.com/01/0122/19711/19711_4.shtml"
target="_blank" style="color:red">web迅雷专用链合作商样板页</a> <a
href="http://union.xunlei.com/download/ASP.rar" target="_blank" style="color:red">附件下载
</a></LI></td> </tr> <tr> <td class=TableRow1 vAlign=center height=25> <LI><FONT color=blue>迅雷高速下载:</FONT><a href="#" thunderHref="<%
=thunderUrl%>" thunderPid="00679" thunderType="" thunderResTitle="<%=SoftName%>"
onClick="return OnDownloadClick_Simple(this,2)" oncontextmenu="ThunderNetwork_SetHref(this)"
><%=SoftName%></a></LI></td> </tr>
<tr> <td class=TableRow1 vAlign=center Align=center> <form action="http://so.xunlei.com/search" target="_blank" method="get"> <div align="center"> <a href="http://www.xunlei.com/" target="_blank"><img
src="< alt="迅雷" align="bottom">
border="0"></a> <input type=text name="search" value="<%=SoftName%>" size=30> <input type="submit" value="迅雷搜索"> <input type="hidden" name="id" value="778"> </div> </form></td> </tr>
</table> </td> </tr> <tr> <td class=left_tdbg1 vAlign=top align=middle> <table style="TABLE-LAYOUT: fixed" cellSpacing=0 cellPadding=0 width="100%"
border=0> <tr> <td class=TableRow2 align=middle height=20><A href="<%=SiteUrl%>">返回首页</A> |
<A href="javascript:window.close()">关闭窗口</A></td> </tr> </table> </td> </tr> </table> </div> <% End If
OK!大功告成!
注:如果是站外资源,快车或者迅雷转换会失效,无法下载。
[视音频技术]电信座机(电话机)设置黑名单的方法(拦截骚扰电… [C语言系列]C#中webBrowser控件屏蔽脚本错误提示方法 [办公软件]设置Word2003文档密码方法详解 [电脑应用]WordPress使用wp-postviews统计文章浏览次数(点击… [Web开发]dede 调用自定义字段方法详解 [C语言系列]C#中combobox 控件属性、事件、方法(部分常用) [Web开发]PHP判断文件是否存在的方法 [Web开发]php使用$_GET获取信息为空时使其不报错的方法 [Web开发]ASP生成Word文档的方法 [Web开发]用asp生成word文档打印的方法
|