下载安卓APP箭头
箭头给我发消息

客服QQ:3315713922

教你怎样利用Asp生成整站静态

作者:课课家     来源: http://www.kokojia.com/点击数:878发布时间: 2015-11-04 17:44:04

标签: ASP开发ASPASP教程

大神带你学编程,欢迎选课

欢迎来到小编的文章进行学习阅读,想必大家又有很多问题吧,在这里会有你想要收获的答案,请大家慢慢学习吧!

计算机变成语言

很多人在网说要全站转静态程序但是大多数都没结果的,所以小妹妹凭着一知半解的写了这个代码希望有了解 ASP转静态技术 交流一下

QUOTE: <%
  On Error Resume Next
  Server.ScriptTimeOut=9999999
  Function getHTTPPage(Path)
   t = GetBody(Path)
   getHTTPPage=BytesToBstr(t,"GB2312")
  End function
  Function GetBody(url)
   on error resume next
   Set Retrieval = CreateObject("Microsoft.XMLHTTP")
   With Retrieval
   .Open "Get", url, False, "", ""
   .Send
   GetBody = .ResponseBody
   End With
   Set Retrieval = Nothing
  End Function   
  Function BytesToBstr(body,Cset)
   dim objstream
   set objstream = Server.CreateObject("adodb.stream")
   objstream.Type = 1
   objstream.Mode =3
   objstream.Open
   objstream.Write body
   objstream.Position = 0
   objstream.Type = 2
   objstream.Charset = Cset
   BytesToBstr = objstream.ReadText
   objstream.Close
   set objstream = nothing
  End Function  
  Function Newstring(wstr,strng)
   Newstring=Instr(lcase(wstr),lcase(strng))
   if Newstring<=0 then Newstring=Len(wstr)
  End Function
%>
xmlhttp.asp

编程语言排行榜上

编程语言(programming language),是用来定义计算机程序的形式语言。它是一种被标准化的交流技巧,用来向计算机发出指令。一种计算机语言让程序员能够准确地定义计算机所需要使用的数据,并精确地定义在不同情况下所应当采取的行动。[1]
最早的编程语言是在电脑发明之后产生的,当时是用来控制提花织布机及自动演奏钢琴的动作。在电脑领域已发明了上千不同的编程语言,而且每年仍有新的编程语言诞生。很多编程语言需要用指令方式说明计算的程序,而有些编程语言则属于声明式编程,说明需要的结果,而不说明如何计算。

c语言编程入门

QUOTE:


<%
url="co.asp?id=2,"
wb_cx=PcMane(url)
                     IF wb_cx<>"" THEN
                     RESPONSE.Write("开始转换静态过程")
                     fso_wstr=split(wb_cx,",")
                            for i=0 to UBound(fso_wstr)-1
                            qman_html_min=(thhs(thhs(fso_wstr(i),"?","~"),".asp","")&".html")       
                            qman_html_min=getHTTPPage(http&fso_wstr(i))
                                   for j=0 to UBound(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
                                          Set fso = Server.CreateObject("Scripting.FileSystemObject")
                                                 FilePath = Server.MapPath(qman_html_url)
                                                        Set fout = fso.CreateTextFile(FilePath)
                                                               qman_html_min=qman_html_min&"

"
                                                               fout.WriteLine qman_html_min
                            NEXT
                     else
                            response.Write("没有成功")
                     END IF



function PcMane(url)
       dim arrID
       arrID =FormateOrderBy(arrID&url)
       http="http://www.gong-z.com/"
       DG_Split=Split(arrID,",")
       for i=0 to Ubound(DG_Split)-1
       DG_href="<(a href=)[\\\\w].+?>"
       DG_wstr_1=DG_wstr_1&stripHTML(">",stripHTML("        next
       if len(arrID)=len(FormateOrderBy(DG_wstr_1)) then
       PcMane=FormateOrderBy(DG_wstr_1)
       exit function
       else
       arrID=PcMane(DG_wstr_1)
       end if
       PcMane = FormateOrderBy(arrID)
end function
Function FormateOrderBy(OrderByText)   
Dim   tmp,tmp2,i,j   
tmp3=""   
tmp   =   Split(OrderByText,",")   
For   i=0   To   Ubound(tmp)-1   
For   j=i+1   To   Ubound(tmp)   
If   UCase(Trim(tmp(i)))=UCase(Trim(tmp(j)))   Then   
tmp(j)=""   
End   If   
Next   
Next   
tmp2=""   
For   i=0   To   Ubound(tmp)   
If   tmp(i)<>""Then tmp2=tmp2&tmp(i)&","   
Next   
FormateOrderBy=Left(tmp2,Len(tmp2))   
End Function

'正则函数
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
RetStr = RetStr & Match.Value&","
Next
RegExpTest = RetStr
End Function
Function stripHTML(patrn,strHTML)
Dim objRegExp, strOutput
Set objRegExp = New Regexp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern =patrn
strOutput = objRegExp.Replace(strHTML, "")
stripHTML = strOutput
Set objRegExp = Nothing
End Function
%>

更多视频课程文章的课程,可到课课家官网查看。我在等你哟!!!

赞(107)
踩(2)
分享到:
华为认证网络工程师 HCIE直播课视频教程