<%
hehe = hello ( "http://mmsg.qq.com/cgi-bin/gddylist?type=13&sort=1&page=3", "<html>", "</html>", ".*(<tdwidth =" " 35%""bgcolor = ""#[/dabcde] {6} ""> (.*) </td>)
응답 .writehehe
FunctionHello (Strurl, Strstart, Strend, Patrn, Replstr)
str = getbody (strurl)
str = mymid (str, strstart, Strend)
str = replacetest (patrn, replstr, str)
안녕하세요 = str
최종 기능 장애
functionmymid (str, strstart, Strend)
ifstrstart = ""그런 다음
i = 0
또 다른
i = instr (str, strstart)
endif
ifstrend = ""그런 다음
j = len (str)
또 다른
j = instr (i, str, strend)
endif
mymid = mid (str, i, j-i+1)
최종 기능 장애
FunctionReplaceTest (PATRN, Replstr, STR1)
Dimregex, 경기, 경기
setRegex = NewRegexp
regex.pattern = patrn
regex.ignorecase = true
regex.global = true
setMatches = regex.execute (str1)
foreachMatchInMatches
replaceTest = replacetest®ex.replace (match.value, replstr)
다음
최종 기능 장애
functiongetBody (URL)
setobjxml = createobject ( "microsoft.xmlhttp")
Withobjxml
. "get", url, false, "", ",", ""
.보내다
getbody = .ResponseBody
끝
getbody = bytestobstr (getbody, "gb2312")
setobjxml = 아무것도 없습니다
최종 기능 장애
functionbyTestObstr (strody, codebase)
setobjstream = server.createobject ( "adodb.stream")
Withobjstream
.type = 1
. 모드 = 3
.열려 있는
.writestbrody
.Position = 0
.type = 2
.charset = 코드베이스
bytestobstr = .ReadText
.닫다
끝
setobjstream = 아무것도
최종 기능 장애
%>
其他调用示例 :
hehe = hello ( "http://list.mp3.baidu.com/song/a.htm", "<tablewidth =" "90%" "border ="0 ""align = ""Center ""CellPadding = ""3 "" "" "0" "bgcolor =" "#f5f5" "" , "<divalign = center>", ".*(<tdwidth =" "20%" "> <ahref =" ".*/. htm" "target = _blank>) (.*) (.