📄 sitemap.asp
字号:
<!--#include file="admin_include.asp"-->
<%
function getdatestr(s)
getdatestr=Year(s)&"-"&Right("0"&Month(s),2)&"-"&Right("0"&Day(s),2)
end function
Sub UpdateSiteMap2Html
On Error Resume Next
xmlfile=server.mappath("../sitemap.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""utf-8""?>")
MyFile.WriteLine("<urlset xmlns=""http://www.google.com/schemas/sitemap/0.84"">")
'Index
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&Directory&Dir_Index&"Index.html</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(now)&"</lastmod>")
MyFile.WriteLine(" <changefreq>daily</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
'ClassLIst
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&Directory&Dir_Class&"ClassList.html</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(now)&"</lastmod>")
MyFile.WriteLine(" <changefreq>daily</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
'Class
sql="select SD_S_Class_Id from [S_Class] order by SD_S_Class_Id desc"
rs.open sql,conn,1,1
if not rs.eof then
while not rs.eof
set rst=conn.execute("select count(*) as SD_Soft_Num from [Soft] where SD_Soft_Class="&rs(0))
Soft_Num=rst("SD_Soft_Num")
rst.close
Cyc_Time=fix(Soft_Num\Page_Size_All)+1
For Cyc = 1 to Cyc_Time
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&Directory&Dir_Class&"Class_"&rs(0)&"_"&Cyc&".html</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(now)&"</lastmod>")
MyFile.WriteLine(" <changefreq>always</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
Next
rs.movenext
wend
end if
rs.close
'Soft
sql="select SD_Soft_Id,SD_Soft_Update from [Soft] order by SD_Soft_Id desc"
rs.open sql,conn,1,1
if not rs.eof then
while not rs.eof
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&Directory&Dir_Soft&DateValue(rs(1))&"/Soft_"&rs(0)&".html</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(rs(1))&"</lastmod>")
MyFile.WriteLine(" <changefreq>always</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
rs.movenext
wend
end if
rs.close
MyFile.WriteLine("</urlset>")
MyFile.Close
if err then
response.Write(err.Description)
response.End()
end if
response.Write("SiteMap鏇存柊鎴愬姛!")
end Sub
Sub UpdateSiteMap2Asp
On Error Resume Next
xmlfile=server.mappath("../sitemap.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""utf-8""?>")
MyFile.WriteLine("<urlset xmlns=""http://www.google.com/schemas/sitemap/0.84"">")
'Index
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&"Index.asp</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(now)&"</lastmod>")
MyFile.WriteLine(" <changefreq>daily</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
'ClassLIst
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&"ClassList.asp</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(now)&"</lastmod>")
MyFile.WriteLine(" <changefreq>daily</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
'Class
sql="select SD_S_Class_Id from [S_Class] order by SD_S_Class_Id desc"
rs.open sql,conn,1,1
if not rs.eof then
while not rs.eof
set rst=conn.execute("select count(*) as SD_Soft_Num from [Soft] where SD_Soft_Class="&rs(0))
Soft_Num=rst("SD_Soft_Num")
rst.close
Cyc_Time=fix(Soft_Num\Page_Size_All)+1
For Cyc = 1 to Cyc_Time
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&"Class.asp?id="&rs(0)&"</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(now)&"</lastmod>")
MyFile.WriteLine(" <changefreq>always</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
Next
rs.movenext
wend
end if
rs.close
'Soft
sql="select SD_Soft_Id,SD_Soft_Update from [Soft] order by SD_Soft_Id desc"
rs.open sql,conn,1,1
if not rs.eof then
while not rs.eof
MyFile.WriteLine(" <url>")
MyFile.WriteLine(" <loc>"&SiteUrl&"Soft.asp?id="&rs(0)&"</loc>")
MyFile.WriteLine(" <lastmod>"&getdatestr(rs(1))&"</lastmod>")
MyFile.WriteLine(" <changefreq>always</changefreq>")
MyFile.WriteLine(" <priority>0.5</priority>")
MyFile.WriteLine(" </url>")
rs.movenext
wend
end if
rs.close
MyFile.WriteLine("</urlset>")
MyFile.Close
if err then
response.Write(err.Description)
response.End()
end if
response.Write("SiteMap鏇存柊鎴愬姛!")
end Sub
if request.QueryString.Count>0 then
R = request.QueryString("do")
if R="html" then
call UpdateSiteMap2Html
elseif R="asp" then
call UpdateSiteMap2Asp
end if
response.End()
end if
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="Css/main.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="../js/jquery.form.js"></script>
<title>鏇存柊SiteMap</title>
<script language="javascript">
<!--
function MakeSiteMap(Fun_type){
//alert("makeHtml.asp?do="+Fun_name);
if (confirm("纭
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -