欢迎来到天天文库
浏览记录
ID:11543160
大小:51.50 KB
页数:9页
时间:2018-07-12
《google网站地图制作代码》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、google网站地图制作代码技术了知2007-11-1416:52:35阅读529评论0字号:大中小用记事本新建一个sitemap.asp文件,把下面的代码复制到sitemap.asp里<%'sitemap_gen.asp'Asimplescripttoautomaticallyproducesitemapsforawebserver,intheGoogleSitemapProtocol(GSP)'byFrancescoPassantino''v0.2released5june2005(Listingadirectorytreerecursivelyimprovement)''BSD
2、2.0license,session("server")="http://www.0574jz.com" '你的域名vDir="/blueidea" '制作SiteMap的目录,相对目录(相对于根目录而言)setobjfso=CreateObject("Scripting.FileSystemObject")root=Server.MapPath(vDir)response.ContentType="text/xml"response.write""response.write"
3、"SetobjFolder=objFSO.GetFolder(root)'response.writegetfilelink(objFolder.Path,objFolder.dateLastModified)SetcolFiles=objFolder.FilesForEachobjFileIncolFiles response.writegetfilelink(objFile.Path,objfile.dateLastModified)NextShowSubFold
4、ers(objFolder)response.write""setfso=nothingSubShowSubFolders(objFolder) SetcolFolders=objFolder.SubFolders ForEachobjSubFolderIncolFolders iffolderpermission(objSubFolder.Path)then response.writegetfilelink(objSubFolder.Path,objSubFolder.dateLastModified) SetcolFiles=ob
5、jSubFolder.Files ForEachobjFileIncolFiles response.writegetfilelink(objFile.Path,objFile.dateLastModified) Next ShowSubFolders(objSubFolder) endif NextEndSubFunctiongetfilelink(file,datafile) file=replace(file,root,"") file=replace(file,"","/") IfFileExtensionIsBad
6、(file)thenExitFunction ifmonth(datafile)<10thenfiledatem="0" ifday(datafile)<10thenfiledated="0" filedate=year(datafile)&"-"&filedatem&month(datafile)&"-"&filedated&day(datafile) getfilelink=""&server.htmlencode(session("server")&vDir&file)&""&filedate&"7、hangefreq>daily1.0" Response.FlushEndFunctionFunctionFolderpermission(pathName) '需要过滤的目录(不列在SiteMap里面) PathExclusion=Array("temp","_vti_cnf","_vti_pvt","_vti_log","cgi-bin") Folderperm
7、hangefreq>daily1.0
此文档下载收益归作者所有