SiteMap.xml 파일을 생성하는 데 사용되는 것들은 Google과 같은 검색 엔진의 크롤링에 도움이됩니다.
<%
Server.ScriptTimeout = 50000
'siteemap_gen.asp
'Asimplescript는 상당 부분을 생산하여 SitemApsforawebserver, inthegoglesitemprotocol (GSP)
'Byfrancescopassantino
'www.iteam5.net/francesco/sitemap
'V0.2Released5june2005 (ListingAdirectoryTreeCurcursifialProvement)
'
'bsd2.0license,
'http://www.opensource.org/licenses/bsd-license.php
'수집 및 분류 : chongqing [email protected]
세션 ( "서버") = "// www.vevb.com"
'도메인 이름
vdir = "/"
'디렉토리와 관련하여 Siteemap이 제작 된 디렉토리를 만듭니다 (루트 디렉토리와 관련하여)
setobjfso = createobject ( "scripting.filesystemobject")
root = server.mappath (vdir)
'응답 .ContentType = "Text/XML"
'response.write "<? xmlversion ='1.0'encoding = 'utf-8'?>"
'response.write "<urlsetxmlns ='http : //www.google.com/schemas/sitemap/0.84 '>."
str = "<? xmlversion = '1.0'encoding ='utf-8 '?>"& vbcrlf
str = str & "<urlsetxmlns = 'http : //www.google.com/schemas/sitemap/0.84'>"& vbcrlf
setobjfolder = objfso.getfolder (루트)
'응답 .WriteGetFilelink (objfolder.path, objfolder.datelastModified)
setcolfiles = objfolder.files
foreachobjfileincolfiles
'응답 .WriteGetFilelink (objfile.path, objfile.datelastModified)
str = str & getfilelink (objfile.path, objfile.datelastmodified) & vbcrlf
다음
showsubfolders (objfolder)
'response.write "</urlset>"
str = str & "</urlset>"& vbcrlf
setfso = 아무것도
setobjstream = server.createobject ( "adodb.stream")
bjstream없이
'.type = adtypetext
'. 모드 = AdmodeReadWrite
.열려 있는
.charSet = "UTF-8"
.Position = objstream.size
.WriteText = str
.SavetOfilesserver.mapath ( "/setemap.xml"), 2 'XML 파일 이름을 생성합니다
.닫다
끝
setobjstream = 아무것도
ifnoterrthen
response.write ( "<cript> alert ( 'success!'); history.back (); </script>")
응답. 엔드
endif
서브 쇼우 폴더 (objfolder)
setcolfolders = objfolder.subfolders
foreachobjsubfolderincolfolders
그런 다음 illerpermission (objsubfolder.path)
'응답 .WriteGetFilelink (objsubfolder.path, objsubfolder.datelastmodified)
str = str & getfilelink (objsubfolder.path, objsubfolder.datelastmodified) & vbcrlf
setcolfiles = objsubfolder.files
foreachobjfileincolfiles
'응답 .WriteGetFilelink (objfile.path, objfile.datelastModified)
str = str & getfilelink (objfile.path, objfile.datelastmodified) & vbcrlf
다음
showsubfolders (objsubfolder)
endif
다음
Endsub