Enregistrez-le en tant que fichier .asp et exécutez-le. Il est très excitant de l'utiliser lorsque vous utilisez ASPHTTP pour capturer du contenu. Bien sûr, vous devez l'améliorer vous-même.
<%
Option Explicit
Functionstriphtml (strhtml)
'Stripsthehtmltagsfromstrhtml
Dimobjregexp, Stroutput
SetObjregexp = newRegexp
objregexp.ignorecase = true
objregexp.global = true
objregexp.Pattern = "<. +?>"
'Rempaceallhtmltagmatches withtheemptystring
Stroutput = objregexp.replace (strhtml, "")
'Rempaceall <et> avec <et>
Stroutput = remplacer (Stroutput, "<", "<")
Stroutput = remplacer (Stroutput, ">", ">")
striphtml = Stroutput'raturthevalueofStroutput
SetObjregexp = rien
Finition de fin
%>
<formMethod = "post" id = form1Name = form1>
<b> enteranhtmlstring: </b> <br>
<TextAreAname = "txthtml" cols = "50" rows = "8" wrap = "virtual"> <% = request ("txthtml")%> </ textarea>
<p>
<portType = "soumi" value = "striphtmltags!" id = soume1Name = soume1>
</ form>
<% iflen (request ("txthtml"))> 0Then%>
<p> <hr> <p>
<b> <u> ViewofString <i> avec NO </i> htmlstripping: </u> </b> <br>
<xmp>
<% = Request ("txthtml")%>
</xmp> <p>
<b> <u> ViewofString <i> avec </i> htmlstripping: </u> </b> <br>
<pre>
<% = Striphtml (demande ("txthtml"))%>
</pre>
<% Endif%>