บันทึกเป็นไฟล์. asp และดำเนินการ มันน่าตื่นเต้นมากที่ได้ใช้สิ่งนี้เมื่อคุณใช้ ASPHTTP เพื่อจับภาพเนื้อหา แน่นอนคุณต้องปรับปรุงด้วยตัวเอง
-
ตัวเลือก Explicit
FunctionStriphtml (strhtml)
'stripthehtmltagsfromstrhtml
dimobjregexp, stroutput
setobjregexp = newregexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.pattern = "<.+?>"
'ReplaceAllHtMlTagMatchesWithTheEmpyString
stroutput = objregexp.replace (strhtml, "")
'replaceall <และ> ด้วย <และ>
stroutput = แทนที่ (Stroutput, "<", "<")
stroutput = แทนที่ (Stroutput, ">", ">")
striphtml = stroutput'returnthevalueofstroutput
setObjregexp = ไม่มีอะไร
endfunction
-
<formMethod = "post" id = form1name = form1>
<b> enteranhtmlstring: </b> <br>
<textareaname = "txthtml" cols = "50" rows = "8" wrap = "เสมือน"> <%= คำขอ ("txthtml")%> </textarea>
<p>
<inputType = "ส่ง" value = "striphtmltags!" id = submit1name = submit1>
</form>
<%iflen (คำขอ ("txthtml"))> 0 แล้ว%>
<p> <hr> <p>
<b> <u> viewofstring <i> withno </i> htmlstripping: </u> </b> <br>
<xmp>
<%= คำขอ ("txTHTML")%>
</xmp> <p>
<b> <u> viewofstring <i> ด้วย </i> htmlStripping: </u> </b> <br>
<pre>
<%= striphtml (คำขอ ("txthtml")))%>
</der>
<%endif%>