asp读取图片或flash高宽,
Function GetFlashAndPic(url,height,width)
Dim sExtName,ExtName,strTemp
sExtName = Split(url, ".")
ExtName = sExtName(UBound(sExtName))
If LCase(ExtName) = "swf" Then
strTemp = "<embed src=""" & url & """ width=" & width & " height=" & height & ">"
Else
strTemp = "<img src=""" & url & """ width=" & width & " height=" & height & " border=0>"
End If
GetFlashAndPic = strTemp
End Function
Function Html2Ubb(str)//把html代码转换成ubb代码
If Str<>"" And Not IsNull(Str) Then
Dim re,tmpstr
Set re=new RegExp
re.IgnoreCase =True
re.Global=True
re.Pattern = "(<STRONG>)":Str = re.Replace(Str,"<b>")
re.Pattern = "(<\/STRONG>)":Str = re.Replace(Str,"</b>")
re.Pattern ="(<TBODY>)":Str = re.Replace(Str,"")
re.Pattern ="(<\/TBODY>)":Str = re.Replace(Str,"")
re.Pattern ="(<TABLE)":Str = re.Replace(Str,"<table")
re.Pattern ="(TABLE>)":Str = re.Replace(Str,"table>")
re.Pattern ="(<TR)":Str = re.Replace(Str,"<tr")
re.Pattern ="(TR>)":Str = re.Replace(Str,"tr>")
re.Pattern ="(<TD)":Str = re.Replace(Str,"<td")
re.Pattern ="(TD>)":Str = re.Replace(Str,"td>")
re.Pattern ="(<DIV)":Str = re.Replace(Str,"<div")
re.Pattern ="(Div>)":Str = re.Replace(Str,"div>")
re.Pattern ="(<IMG )":Str = re.Replace(Str,"<img ")
re.Pattern ="(<BR)":Str = re.Replace(Str,"<br")
re.Pattern ="(<A )":Str = re.Replace(Str,"<a ")
re.Pattern ="(<\/A>)":Str = re.Replace(Str,"</a>")
re.Pattern ="(<FONT )":Str = re.Replace(Str,"<font ")
re.Pattern ="(<\/FONT>)":Str = re.Replace(Str,"</font>")
re.Pattern = "(<s+cript(.+?)<\/s+cript>)":Str = re.Replace(Str, "")
re.Pattern ="(\{)":Str = re.Replace(Str,"{")
re.Pattern ="(\})":Str = re.Replace(Str,"}")
re.Pattern ="(\$)":Str = re.Replace(Str,"$")
're.Pattern = "(<div>|<div(.+?)>)":Str = re.replace(Str,"<div>")
're.Pattern = "(<span>|<span(.+?)>)":Str = re.replace(Str,"<span>")
Set Re=Nothing
Html2Ubb = Str
Else
Html2Ubb = ""
End If
End Function