20-10-13, 01:35 PM
لو اردنا اخذ الجزئية التالية:
من النص التالي:
<img src="http://vb4arb.com/vb/images/twilight/logo.png
فماذا نستخدم
من النص التالي:
<img src="http://vb4arb.com/vb/images/twilight/logo.png
Dim Link As String = "<img src=""http://vb4arb.com/vb/images/twilight/logo.png"
Link = Link.Substring(Link.IndexOf("""") + 1)
Dim Page As String = "<img src=""http://vb4arb.com/vb/images/twilight/logo.png"
Dim Reg As New Regex(""".*")
Dim Ma As Match = Reg.Match(Page)
Dim Link As String = Page.Substring(Ma.Index + 1, Ma.Length - 1)
Dim mch As Match = Regex.Match("<img src=""http://vb4arb.com/vb/images/twilight/logo.jpg", "http://vb4arb\.com/vb/images/twilight/logo\.(png|jpg|gif)", RegexOptions.IgnoreCase)
If mch.Success Then
MsgBox(mch.Value)
End If
Dim mch As Match = Regex.Match("<img src=""http://vb4arb.com/vb/images/twilight/logo.jpg", "http:.*\.(png|jpg|gif)", RegexOptions.IgnoreCase)
http://vb4arb.com/vb
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mch As Match = Regex.Match("<img src=""http://vb4arb.com/vb/images/twilight/logo.jpg", "http:.*\.(png|jpg|gif)", RegexOptions.IgnoreCase)
If mch.Success Then
'' MsgBox(mch.Value)
MsgBox(IO.Path.GetFileName(mch.Value))
End If
End Sub
Dim a As String = "http://vb4arb.com/vb/images/twilight/loaaaaaaaaaaaaago.jpg"
MsgBox(IO.Path.GetFileName(a))
Dim b() As Byte = (From C As Char In FileName.ToCharArray Select CByte(AscW(C))).ToArray
FileName = System.Text.Encoding.UTF8.GetString(b)