'请版主和各位家人帮忙看看.谢谢
'问题在
---------------------------------------------------
号处标出
..........................头部略
Function ShowDownAddress(softid)
Dim rsAddress, sqlAddress, rsDown
Dim DownText,showdown
Dim DownloadName, DownloadPath
Dim DownAddress
If ErrMsg>"" Then
----------------------------
'ErrMsg>"" 这里我不知到该怎么用.,刚学几天ASP
'我是想在 有 下载错误提示ErrMsg值时不执行以下代码,没有提示时执行这段代码.
'请版主和家人帮看看,先谢谢了
'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 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") = 0 Then
DownloadPath = "download.asp?softid=" & softid & "&downid=" & rsAddress("downid") & "&id=" & rsDown(0)
Else
DownloadPath = rsAddress("DownloadPath") & rsDown(2)
End If
If rsAddress("UserGroup") > 0 Then
DownloadName = Replace(rsAddress("DownLoadName"), "{$DownPoint}", rsAddress("DownPoint"))
Else
DownloadName = Replace(rsAddress("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
Else
End If
End Function
CloseConn