코드 사본은 다음과 같습니다.
<%@language = "vbscript"CodePage = "936"%>
<!-#includefile = "conn.asp"->
<!-#includefile = "inc/function.asp"->
<! doctypehtmlpublic "-// w3c // dtdhtml4.01transitional // en"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
<헤드>
<title> UntitledDocument </title>
<metahttp-equiv = "content-type"content = "text/html; charset = gb2312">
<metahttp-equiv = "Refresh"content = "300; url = steal_house.asp">
</head>
<body>
<%
onerrorresumenext
'
Server.ScriptTimeout = 999999
'========================================================================================
'문자 인코딩 기능
'===========================================================================================
functionByTestObstr (Body, Code)
Dimobjstream
setobjstream = server.createobject ( "adodb.stream")
objstream.type = 1
objstream.mode = 3
objstream.open
objstream.writebody
objstream.position = 0
objstream.type = 2
objstream.charset = 코드
bytestobstr = objstream.readtext
objstream.close
setobjstream = 아무것도
최종 기능 장애
'줄 문자열의 발생 위치를 다른 문자열에서 가져옵니다
FunctionNewString (WSTR, strng)
NewsString = instr (lcase (wstr), lcase (strng))
ifnewstring <= 0thennewstring = len (wstr)
최종 기능 장애
'문자열 함수를 교체하십시오
FunctionReplacest (ori, str1, str2)
REPLACESTR = REPLEC (ORI, STR1, STR2)
최종 기능 장애
'===========================================================================================
functionreadxml (url, code, start, end)
setosend = createobject ( "microsoft.xmlhttp")
sourcecode = osend.open ( "get", url, false)
osend.send ()
readxml = bytestobstr (osend.responsebody, code)
start = instr (readxml, start)
readxml = mid (readxml, 시작)
ENDS = instr (readxml, Ends)
readxml = left (readxml, ends-1)
최종 기능 장애
functionsubstr (신체, 시작, 끝)
start = instr (Body, Start)
substr = mid (body, start+len (시작) +1)
ENDS = Instr (substr, Ends)
substr = 왼쪽 (substr, ends-1)
최종 기능 장애
DIMGETCONT, 뉴스 콘텐츠
Dimurl, 제목
url = "http : //www.***.com" '뉴스 웹 사이트
getCont = readxml (url, "gb2312", "<tableclass = k2border =" "0" "", "</table>")
getCont = regexhtml (getCont)
Dimkeyid, Newsclass, 도시, 위치, 하우스 타입, 레벨, 지역, 가격, 데모 스트라
DIMCONTACTMAN, 연락처
fori = 2toubund (getcont)
response.write (getCont (i) & "__ <br>")
templink = mid (getCont (i), 악기 (getCont (i), "href =" "")+6, 악기 (getCont (i), "" "
Onclick ") -10)
templink = replace (templink, "../", "")
response.write (i & ":"& templink & "<br>")