1683 次
4 に答える
0
わかりました、私はこれを得ることができたと思います:
If strContent.Contains(".mp3""") Then 'check if content contains .mp3
'find the href tag usin regex
Dim pattern As String = "(href=\s*\""(.+?)\"")"
Dim html As String = strContent
Dim href() As String = Regex.Split(html, pattern)
Dim href1 As String = href(1) 'gets the href tag
'make sure that this href contains contains .mp3 (and it's not some other)
If href1.Contains(".mp3""") Then
'this is a hidden control to display on summary main category page
Dim atemp As hyperlink = e.Item.FindControl("lnkSound")
'remove the href= and quotes from the href
'set the naviate url
atemp.navigateurl = href1.Replace("href=", "").Replace(chr(34), "")
atemp.target = "_blank"
'make it visible as hidden for summarys that don't contain .mp3
atemp.visible = True
End If
End If
並べ替えました。
于 2013-07-19T12:39:06.857 に答える