| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 544 人关注过本帖
标题:新云的SOFTDOWN码,是不是有问题,怎么右键点只能下个DOWN。ASP
只看楼主 加入收藏
shy52502
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2006-12-9
收藏
 问题点数:0 回复次数:0 
新云的SOFTDOWN码,是不是有问题,怎么右键点只能下个DOWN。ASP

<!--#include file="config.asp"-->
<%
Dim Rs,SQL,HtmlContent
Dim softid,SoftName,SoftSize
Dim SoftContent,SoftTime,AllHits,filesize
Dim ChannelRootDir,strInstallDir,strIndexName
Dim HtmlFileUrl,HtmlFileName,strUrl

Newasp.ReadChannel(ChannelID)
ChannelRootDir = Newasp.InstallDir & Newasp.ChannelDir
strInstallDir = Newasp.InstallDir
strIndexName = "<a href='" & ChannelRootDir & "'>" & Newasp.ChannelName & "</a>"
softid = Newasp.ChkNumeric(Request.Querystring("softid"))

If softid = 0 Then
OutAlertScript("错误的系统参数!请输入正确的软件ID")
Response.End
End If

Newasp.LoadTemplates ChannelID, 6, Newasp.ChannelSkin
HtmlContent = Newasp.HtmlContent
HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", ChannelRootDir)
HtmlContent = Replace(HtmlContent, "{$InstallDir}", Newasp.InstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", ChannelID)
HtmlContent = Replace(HtmlContent, "{$ModuleName}", Newasp.ModuleName)
HtmlContent = Replace(HtmlContent, "{$SoftIndex}", strIndexName)


SQL = "SELECT A.softid,A.SoftName,A.SoftVer,A.Content,A.SoftSize,A.SoftTime,A.AllHits,A.HtmlFileDate,C.HtmlFileDir FROM NC_SoftList A INNER JOIN [NC_Classify] C On A.ClassID=C.ClassID WHERE A.ChannelID="& ChannelID &" And A.isAccept <> 0 And A.SoftID=" & SoftID
Set Rs = Newasp.Execute(SQL)
If Rs.EOF And Rs.BOF Then
OutAlertScript("对不起~!没有找到你想下载的软件。")
Set Rs = Nothing
Else
SoftName = Trim(Rs("SoftName") &" "& Rs("SoftVer"))
SoftTime = Rs("SoftTime")
AllHits = Rs("AllHits")
SoftContent = Ubbcode(Rs("Content"))
If CLng(Rs("SoftSize")) > 0 Then
SoftSize = ReadSoftsize(Rs("SoftSize"))
Else
SoftSize = "未知大小"
End If
filesize = CCur(Rs("SoftSize"))
If CInt(Newasp.IsCreateHtml) <> 0 Then
HtmlFileUrl = ShowChannelPath(ChannelRootDir, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.HtmlPath)
HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("softid"), Newasp.HtmlExtName, Newasp.HtmlPrefix, Newasp.HtmlForm, "")
strUrl = HtmlFileUrl & HtmlFileName
Else
strUrl = ChannelRootDir & "show.asp?id="& Rs("softid")
End If
End If
Rs.Close:Set Rs = Nothing


HtmlContent = Replace(HtmlContent, "{$PageTitle}", SoftName)
HtmlContent = Replace(HtmlContent, "{$SoftID}", softid)
HtmlContent = Replace(HtmlContent, "{$softid}", softid)
HtmlContent = Replace(HtmlContent, "{$SoftName}", SoftName)
HtmlContent = Replace(HtmlContent, "{$strUrl}", strUrl)
HtmlContent = Replace(HtmlContent, "{$Updatetime}", SoftTime)
HtmlContent = Replace(HtmlContent, "{$SoftSize}", SoftSize)
HtmlContent = Replace(HtmlContent, "{$FileSize}", FileSize)
HtmlContent = Replace(HtmlContent, "{$AllHits}", AllHits)
HtmlContent = Replace(HtmlContent, "{$SoftContent}", SoftContent)
HtmlContent = Replace(HtmlContent, "{$ShowDownAddress}", ShowDownAddress(softid))
HtmlContent = ReadClassMenu(HtmlContent)
HtmlContent = ReadClassMenubar(HtmlContent)
HtmlContent = Replace(HtmlContent, "{$SkinPath}", Newasp.SkinPath)
HtmlContent = Replace(HtmlContent,"{$InstallDir}", Newasp.InstallDir)
Response.Write HtmlContent

'================================================
'函数名:ReadSoftsize
'作 用:读取软件的大小
'================================================
Function ReadSoftsize(para)
On Error Resume Next
Dim strFileSize, parasize

parasize = CCur(para)

If parasize = 0 Then
ReadSoftsize = "未知大小"
Exit Function
End If

If parasize > 1024 * 1024 Then
strFileSize = Round(parasize / 1024 / 1024, 2) & " GB"
ElseIf parasize > 1024 Then
strFileSize = Round(parasize / 1024, 2) & " MB"
Else
strFileSize = parasize & " KB"
End If
ReadSoftsize = strFileSize
End Function

Function ShowDownAddress(softid)
Dim rsAddress, sqlAddress, rsDown
Dim DownText,showdown
Dim DownloadName, DownloadPath
Dim DownAddress,selfont

On Error Resume Next
showdown = Newasp.ChkNumeric(Newasp.HtmlSetting(1))

Set rsDown = Newasp.Execute("SELECT id,downid,DownFileName,DownText FROM [NC_DownAddress] WHERE softid=" & CLng(softid))
If Not (rsDown.BOF And rsDown.EOF) Then
Do While Not rsDown.EOF
DownText = rsDown("DownText") & ""
If Len(DownText) = 0 Then DownText = "立即下载"
'---- 如果使用了下载服务器,就打开下载服务器数据表
If rsDown("downid") > 0 Then
sqlAddress = "SELECT downid,DownloadName,DownloadPath,IsDisp,DownPoint,UserGroup,IsOuter,selfont FROM NC_DownServer WHERE ChannelID=" & ChannelID & " And depth=1 And rootid =" & rsDown("downid") & " And isLock=0 ORDER BY orders ASC"
Set rsAddress = Newasp.Execute(sqlAddress)
If rsAddress.EOF And rsAddress.BOF Then
DownloadPath = ""
DownloadName = ""
Else
Do While Not rsAddress.EOF
DownAddress = DownAddress & Newasp.HtmlSetting(3)
'---- 是否直接显示软件直接的下载地址
If rsAddress("IsDisp") <> 1 Then
DownloadPath = "download.asp?softid=" & softid & "&downid=" & rsAddress("downid") & "&id=" & rsDown(0)
Else
If rsAddress("IsOuter") <> 1 Then
DownloadPath = Trim(rsAddress("DownloadPath") & rsDown(2))
Else
DownloadPath = Trim(rsAddress("DownloadPath"))
End If
End If

selfont = rsAddress("selfont") & ""
If Len(selfont) < 10 Then
DownloadName = rsAddress("DownloadName")
Else
DownloadName = "<span " & selfont & ">" & rsAddress("DownloadName") & "</span>"
End If
If rsAddress("UserGroup") > 0 Then
DownloadName = Replace(DownloadName, "{$DownPoint}", rsAddress("DownPoint"))
Else
DownloadName = Replace(DownloadName, "{$DownPoint}", 0)
End If
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", DownloadPath)
DownAddress = Replace(DownAddress, "{$DownLoadName}", DownloadName)
rsAddress.MoveNext
Loop
End If
Set rsAddress = Nothing
Else
DownAddress = DownAddress & Newasp.HtmlSetting(3)
If showdown > 0 Then
DownloadPath = Trim(rsDown("DownFileName") & "")
Else
DownloadPath = "download.asp?softid=" & softid & "&downid=0&id=" & rsDown(0)
End If
DownAddress = Replace(DownAddress, "{$DownLoadUrl}", DownloadPath)
DownAddress = Replace(DownAddress, "{$DownLoadName}", DownText)
End If
rsDown.MoveNext
Loop
End If
Set rsDown = Nothing
DownAddress = Replace(DownAddress, "{$SoftName}", SoftName)
DownAddress = Replace(DownAddress, "{$ChannelRootDir}", ChannelRootDir)
DownAddress = Replace(DownAddress, "{$InstallDir}", Newasp.InstallDir)
ShowDownAddress = DownAddress
End Function

CloseConn
%>

搜索更多相关主题的帖子: SOFTDOWN ASP 
2006-12-09 01:15
快速回复:新云的SOFTDOWN码,是不是有问题,怎么右键点只能下个DOWN。ASP
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030664 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved