|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
实现规模效益。与传统的用户拥有硬件软件所有权和使用权以及传统的应用服务商提供一对一的服务模式不同,ASP拥有应用系统所有权,用户拥有使用权,应用系统集中放在ASP的数据中心中,集中管理,分散使用,以一对多的租赁的形式为众多用户提供有品质保证的应用技术服务,实现规模效益。良多人在网说要全站转静态程序可是年夜多半都没了局的,以是小mm凭着一孔之见的写了这个代码但愿有懂得asp转静态手艺交换一下
QUOTE:<%
OnErrorResumeNext
Server.ScriptTimeOut=9999999
FunctiongetHTTPPage(Path)
t=GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
Endfunction
FunctionGetBody(url)
onerrorresumenext
SetRetrieval=CreateObject("Microsoft.XMLHTTP")
WithRetrieval
.Open"Get",url,False,"",""
.Send
GetBody=.ResponseBody
EndWith
SetRetrieval=Nothing
EndFunction
FunctionBytesToBstr(body,Cset)
dimobjstream
setobjstream=Server.CreateObject("adodb.stream")
objstream.Type=1
objstream.Mode=3
objstream.Open
objstream.Writebody
objstream.Position=0
objstream.Type=2
objstream.Charset=Cset
BytesToBstr=objstream.ReadText
objstream.Close
setobjstream=nothing
EndFunction
FunctionNewstring(wstr,strng)
Newstring=Instr(lcase(wstr),lcase(strng))
ifNewstring<=0thenNewstring=Len(wstr)
EndFunction
%>
xmlhttp.asp
QUOTE:<!--#includefile="xmlhttp.asp"-->
<%
url="co.asp?id=2,"
wb_cx=PcMane(url)
IFwb_cx""THEN
RESPONSE.Write("入手下手转换静态历程")
fso_wstr=split(wb_cx,",")
fori=0toUBound(fso_wstr)-1
qman_html_min=(thhs(thhs(fso_wstr(i),"?","~"),".asp","")&".html")
qman_html_min=getHTTPPage(http&fso_wstr(i))
forj=0toUBound(fso_wstr)-1
qman_html_min=thhs(qman_html_min,fso_wstr(j),thhs(thhs(fso_wstr(j),"?","~"),".asp","")&".html")
qman_html_min=thhs(qman_html_min,".html&",".html?")
next
Setfso=Server.CreateObject("Scripting.FileSystemObject")
FilePath=Server.MapPath(qman_html_url)
Setfout=fso.CreateTextFile(FilePath)
qman_html_min=qman_html_min&"<scripttype=text/javascript>"&_
"if(!document.location.search==)"&_
"{"&_
"varh=location.href;"&_
"varr=newRegExp([^?]*/([^&]*),i);"&_
"vart=h.match(r);"&_
"if(t)"&_
"{"&_
"varstr=t[1];"&_
"newstr=str.replace(.html?,&);"&_
"location=newstr+.html;"&_
"}"&_
"}"&_
"</script>"
fout.WriteLineqman_html_min
NEXT
else
response.Write("没有乐成")
ENDIF
functionPcMane(url)
dimarrID
arrID=FormateOrderBy(arrID&url)
http="http://www.gong-z.com/"
DG_Split=Split(arrID,",")
fori=0toUbound(DG_Split)-1
DG_href="<(ahref=)[w].+?>"
DG_wstr_1=DG_wstr_1&stripHTML(">",stripHTML("<ahref=",RegExpTest(DG_href,getHTTPPage(http&DG_Split(i)))))
next
iflen(arrID)=len(FormateOrderBy(DG_wstr_1))then
PcMane=FormateOrderBy(DG_wstr_1)
exitfunction
else
arrID=PcMane(DG_wstr_1)
endif
PcMane=FormateOrderBy(arrID)
endfunction
FunctionFormateOrderBy(OrderByText)
Dimtmp,tmp2,i,j
tmp3=""
tmp=Split(OrderByText,",")
Fori=0ToUbound(tmp)-1
Forj=i+1ToUbound(tmp)
IfUCase(Trim(tmp(i)))=UCase(Trim(tmp(j)))Then
tmp(j)=""
EndIf
Next
Next
tmp2=""
Fori=0ToUbound(tmp)
Iftmp(i)""Thentmp2=tmp2&tmp(i)&","
Next
FormateOrderBy=Left(tmp2,Len(tmp2))
EndFunction
正则函数
FunctionRegExpTest(patrn,strng)
DimregEx,Match,Matches
SetregEx=NewRegExp
regEx.Pattern=patrn
regEx.IgnoreCase=True
regEx.Global=True
SetMatches=regEx.Execute(strng)
ForEachMatchinMatches
RetStr=RetStr&Match.Value&","
Next
RegExpTest=RetStr
EndFunction
FunctionstripHTML(patrn,strHTML)
DimobjRegExp,strOutput
SetobjRegExp=NewRegexp
objRegExp.IgnoreCase=True
objRegExp.Global=True
objRegExp.Pattern=patrn
strOutput=objRegExp.Replace(strHTML,"")
stripHTML=strOutput
SetobjRegExp=Nothing
EndFunction
%>
ASP.NET和ASP的比较,技术上比较已经没什么可说的了.新一代在大部分程度来说当然是比旧一代好了.关键看你对所做软件的理解了.因人而定.会写的话也可能比ASP.NET写得更有效率和更方便重用 |
|