六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

使用正則表達式完成模式圖片新聞.ASP

[摘要]'文字或特定圖片模式顯示新聞function shownew(content,ntype)shownew = ""if(ntype = 1) thenshownew = shownew &" <TABLE width=100% >"...

'文字或特定圖片模式顯示新聞

function shownew(content,ntype)

shownew = ""

if(ntype = 1) then

shownew = shownew &" <TABLE width=100% >"
shownew = shownew &"<TR>"
shownew = shownew &" <TD width=600 style='word-break:break-all' valign=top>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD valign=top style='word-break:break-all'>"&OnlyWord(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"


elseif (ntype = 2) then


shownew = shownew &" <TABLE width='100%'>"

shownew = shownew &"<TR>"
shownew = shownew &" <TD style='word-break:break-all' valign=top>"&OnlyWord(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"<TR>"
shownew = shownew &" <TD  width=600 valign=top style='word-break:break-all'>"&ShowPic(content)&"</TD>"
shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"

elseif (ntype = 3) then


shownew = shownew &"<TABLE>"

shownew = shownew &"<TR>"
 shownew = shownew &"<TD width=100 valign=top>"&ShowPic(content)&"</TD>"

 shownew = shownew &"<TD width=80% style='word-break:break-all' valign=top>"&OnlyWord(content)&"</TD>"


shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"

elseif (ntype = 4) then

shownew = shownew &"<TABLE>"

shownew = shownew &"<TR>"

  shownew = shownew &"<TD width=80% valign=top style='word-break:break-all'>"&OnlyWord(content)&"</TD>"
 shownew = shownew &"<TD width=100  valign=top>"&ShowPic(content)&"</TD>"

shownew = shownew &"</TR>"
shownew = shownew &"</TABLE>"
else
 shownew = shownew & "<table><tr><td style='word-break:break-all'>"&content&"</td></tr></table>"
end if

end function

'顯示提取的圖片
function ShowPic(strng)

 ShowPic = ""
 ImageUrl= RegExpExecute(strng)

 ImageUrls = Split(ImageUrl,"<BR>")

 for i = LBound(ImageUrls) to (UBound(ImageUrls) - 1)

    ShowPic = ShowPic & ("<a href='"&ImageUrls(i)&"' target=_blank><image src='"&ImageUrls(i)&"' border='0' alt='按此在新窗口瀏覽圖片' onload='javascript:if(this.width>180)this.width=180'></a>")

    next
 
end function


'從內容中提取圖片
Function RegExpExecute(strng)
    Dim regEx, Match, Matches '建立變量。
    Set regEx = New RegExp '建立正則表達式。
      regEx.Pattern = "(src=)(' "&CHR(34)&" )?(.[^' \s "&CHR(34)&"]*)(\.)(jpg gif png bmp jpeg)(' "&CHR(34)&" \s >)?" '設置模式。
   ' regEx.Pattern = "(src=)(' "&CHR(34)&" )?(.[^' "&CHR(34)&"]*)(\.)(jpg gif png bmp jpeg)(' "&CHR(34)&" >)?" '設置模式。
    'regEx.Pattern = "(s S)(r R)(c C)=(' "+CHR(34)+")(\w \\ \/ \.)+(' "+CHR(34)+" * >)?" '設置模式。
    regEx.IgnoreCase = true '設置是否區分字符大小寫。
    regEx.Global = True '設置全局可用性。
    Set Matches = regEx.Execute(strng) '執行搜索。
    For Each Match in Matches '遍歷匹配集合。
       values=values&Match.SubMatches(2)&Match.SubMatches(3)&Match.SubMatches(4)&"<BR>"
    Next
   RegExpExecute = values
End Function

'刪除內容中與圖片有關的代碼
function OnlyWord(strng)
  Set re=new RegExp
  re.IgnoreCase =True
  re.Global=True
 
     re.Pattern = "(<)(.[^<]*)(src=)(' "&CHR(34)&" )?(.[^' \s "&CHR(34)&"]*)(\.)(jpg gif png bmp jpeg)(' "&CHR(34)&" \s >)(.[^>]*)(>)" '設置模式。
  OnlyWord=re.Replace(strng,"")
  Set re= nothing

end function




主站蜘蛛池模板: 亚洲爱视频 | 日韩激情视频在线观看 | 欧美视频在线免费 | 日本中文一二区有码在线观看 | 日本不卡在线视频高清免费 | 亚洲国产成人久久一区二区三区 | 三级黄免费 | 天天干狠狠操 | 日韩欧美中文字幕一区二区三区 | 欧美性猛交xxxx乱大交be | 自偷自偷自亚洲首页精品 | 速度与激情9免费观看 | 婷婷综合缴情亚洲狠狠图片 | 欧美淫片 | 色婷婷在线视频 | 四虎成人4hutv影院 | 日日摸人人看97人人澡 | 日本视频一区在线观看免费 | 青娱乐免费视频在线观看 | 亚洲综合站 | 日本特黄特色aa大片免费 | 日本v片免费一区二区三区 日本vs欧美一区二区三区 | 亚洲mv日韩mv欧美mv | 手机看片自拍日韩日韩高清 | 青娱乐极品视频在线 | 日韩美女在线 | 亚州一级毛片在线 | 日韩欧美视频在线播放 | 在线看av网址| 一级毛片一级毛片一级毛片aaav | 亚洲精品第三页 | 日本aa网站| 青娱乐色 | 午夜精品福利在线观看 | 欧美一欧美一区二三区性 | 午夜老司机免费视频 | 日日夜夜天天操 | 无码精品一区二区三区免费视频 | 色婷婷5月精品久久久久 | 亚洲综合资源 | 青娱极品盛宴国产一区 |