skycnmakecn.asp
来自「多用户管理分权限发布、管理软件信息; 自由选择系统默认为静态HTML或动态A」· ASP 代码 · 共 173 行
ASP
173 行
<%
dim CacheName
CacheName = Replace(Replace(Replace(Replace(LCase(Server.MapPath("index.asp")),"index.asp",""),":",""),"\",""),"admin","")
if session(CacheName & "AdminName")="" then
Response.redirect "login.asp"
Response.End
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>批量自动生成本地数据库</title>
<style type="text/css">
<!--
body,td,th {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>
</head>
<body>
<%
if request("type")="all" then
Ds=timer()
'response.write request.Form("skycnid")
response.write"<b><font color=""#FF0000"">正在生成天空软件下载的本地数据库,请等待......</font></b><BR><span id=showImport></span><IE:Download ID=""oDownload"" STYLE=""behavior:url(#default#download)"" />"
if not isempty(request("skycnid")) then
idlist=request("skycnid")
if instr(idlist,",")>0 then
dim idArr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call MakeHtml(id)
next
else
call MakeHtml(clng(idlist))
end if
end if
Sub MakeHtml(id)
response.write"<script>function onDownloadDone(downDate){showImport.innerHTML=downDate}oDownload.startDownload('SoftWrite.asp?id="&id&"',onDownloadDone)</script>"
end Sub
else
'url=Request("url")
url="new"
on error resume next
Function bytes2BSTR(vIn)
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr (CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
Url = "http://www2.skycn.com/"&url&"/01.html"
set oSend=createobject("Microsoft.XMLHTTP")
SourceCode = oSend.open ("GET",url,false)
oSend.send()
if err.number<>0 then
Response.write err.description
Response.End()
end if
SourceCode = bytes2BSTR(oSend.responseBody)
'SourceCode =replace(SourceCode,"http://count.skycn.com/softdownloadload.php?id="&Id&"&url=","")
SourceCode=GetSourceCode(SourceCode,"<td vAlign=top width='100%' height='100%'>","</table></td></tr></table>","<td vAlign=top width='100%' height='100%'>")
'SoftOS=GetSourceCode(SourceCode,"<br><b>应用平台:</b>","<br><b>界面预览:</b>","<br><b>应用平台:</b>")
'取软件各种信息
'SourceCode_0是页面取得的总数据
''SourceCode_1是截取需要内容所需的开始位置的代码'
''SourceCode_1是截取需要内容所需的结束位置的代?
''SourceCode_1是截取需要内容所需的代码中多余的内容
Function GetSourceCode(SourceCode_0,SourceCode_1,SourceCode_2,SourceCode_3)
between=instr(SourceCode_0,SourceCode_1)-instr(SourceCode_0,SourceCode_2)
first=instr(SourceCode_0,SourceCode_1)
GetSourceCode = Mid(SourceCode_0,first,abs(between))
GetSourceCode =replace(GetSourceCode,SourceCode_3,"")
end function
function UBBCode(strContent)
dim re,i
UbbCode=strContent
Set re=new RegExp
re.IgnoreCase =true
re.Global=True
if instr(1,strContent,"../soft/",1)>0 then
re.Pattern = "^(../soft/[0-9]+)"
strContent = re.Replace(strContent,"<input name=skycnid type=checkbox checked value=$1 ")
re.Pattern = "(../soft/[0-9]+)$"
strContent = re.Replace(strContent,"<input name=skycnid type=checkbox checked value=$1 ")
re.Pattern = "([^>=""])(../soft/[0-9]+)"
strContent = re.Replace(strContent,"$1<input name=skycnid type=checkbox checked value=$2 ")
end if
set re=Nothing
UBBCode=strContent
end function
SourceCode=UBBCode(SourceCode)
SourceCode=replace(SourceCode,"../soft/","")
SourceCode=replace(SourceCode,"<A href='","")
SourceCode=replace(SourceCode,".html'","")
SourceCode=replace(SourceCode,"href='","")
%>
<SCRIPT language=javascript>
function CheckOthers(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
// if (e.name != 'chkall')
if (e.checked==false)
{
e.checked = true;// form.chkall.checked;
}
else
{
e.checked = false;
}
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
// if (e.name != 'chkall')
e.checked = true// form.chkall.checked;
}
}
</SCRIPT>
<%
response.write"<form name=""form1"" method=""post"" action=""SkycnSoftMakeNew.asp?type=all"">"
response.write "<b>以下是天空下载,最新更新的软件,请选择您要更新的项目</B><BR>"
response.write "<input type=button class=button onclick='CheckAll(this.form)' value='全选'>"
response.write "<input type=button class=button onclick='CheckOthers(this.form)' value='反选'>"
response.write "<input type=""submit"" name=""Submit"" value=""确定"">"
response.write UBBCode(SourceCode)
response.write "</table>"
response.write "<input type=button class=button onclick='CheckAll(this.form)' value='全选'>"
response.write "<input type=button class=button onclick='CheckOthers(this.form)' value='反选'>"
response.write "<input type=""submit"" name=""Submit"" value=""确定"">"
response.write "</form>"
end if
%></body></html>
<%end if%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?