blöderweise gelangt er direkt zum zweiten ich will nur den am Anfang es gibt 2 der selben nur mit verschiedenen Inhalt.
was kann man da machen?
|
|
Visual Basic Quellcode |
1 |
Dim ipRegEx As New Regex("\<a href=\""(?<string>([a-z.]*))""\>") |
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim httpRequest As HttpWebRequest = HttpWebRequest.Create("http://192.168.178.25") Dim httpResponse As HttpWebResponse = httpRequest.GetResponse() Dim reader As StreamReader = New StreamReader(httpResponse.GetResponseStream) Dim httpContent As String = reader.ReadToEnd txtSourcecode.Text = httpContent Dim ipRegEx As New Regex("\<a href=\""(?<string>([a-z.]*))""\>") Dim myIP As String = ipRegEx.Match(httpContent).Groups("string").ToString() lblIP.Text = "Deine IP: " & myIP End Sub |
|
|
Visual Basic Quellcode |
1 2 3 |
For Each m As Match In ipRegEx.Matches(httpContent) MsgBox(m.Groups("string").Value.ToString()) Next |
) merhmals vorkommend

|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
Imports System.Net Imports System.IO Imports System.Text.RegularExpressions Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim httpRequest As HttpWebRequest = HttpWebRequest.Create("http://192.168.178.25") Dim httpResponse As HttpWebResponse = httpRequest.GetResponse() Dim reader As StreamReader = New StreamReader(httpResponse.GetResponseStream) Dim httpContent As String = reader.ReadToEnd txtSourcecode.Text = httpContent Dim ipRegEx As New Regex("\<a href=\""(?<string>([.*?]*))""\>") Dim myIP As String = ipRegEx.Match(httpContent).Groups("string").ToString() lblIP.Text = "Deine IP: " & myIP For Each m As Match In ipRegEx.Matches(httpContent) MsgBox(m.Groups("string").Value.ToString()) Next End Sub End Class |
|
|
Quellcode |
1 2 3 4 5 6 |
<html><head><title>Generatepage</title></head><body style="background-color: #CCCCCC; font-family: Verdana;"><center><table style="width: 100%; background-color: #EEEEEE; border-width: 1px; border-style: dotted; text-align: center;"><tr>
<td><font size="+2">Test123</font><br />
<font size="-2">Testpage123</font></td></tr></table><br />
<a href="123.iso">Download fertiges Image 123.iso</a><br />
<a href="close">Schließe befehlsleiste</a>
</center></body></html>
|
|
|
Quellcode |
1 |
"\<a href=\""(?<string>(.*?))""\>" |
Trotzdem schön, dass du eigeninitiative zeigst

|
|
Visual Basic Quellcode |
1 2 3 4 5 6 |
Dim adresse As New System.Text.RegularExpressions.Regex("<span class=""street street-address"">[^>]*</span>") Dim matches As MatchCollection = adresse.Matches(sourcecode) For Each itemcode As Match In matches tbZKneuStrasseHsnr.Text = (itemcode.Value.Split("""").GetValue(2)) Next |
Zitat
<img src="/img/aa_img.php?gnm=F46A334676CA4378E2E69F74AF4CC7B91B49F45738D6D590B99AB659CD08DAE321A2CBA9E761216DC39C79BBB63C756A" width="123" border="0" height="50">
|
|
Visual Basic Quellcode |
1 2 3 4 5 6 7 8 9 |
Dim httpRequest As HttpWebRequest = HttpWebRequest.Create("") Dim httpResponse As HttpWebResponse = httpRequest.GetResponse() Dim reader As StreamReader = New StreamReader(httpResponse.GetResponseStream) Dim httpContent As String = reader.ReadToEnd TextBox3.Text = httpContent Dim ipRegEx As New Regex("\<img src=\""(?<string>([a-zA-Z0-9./_?=]*))\"" width=\""123\"" border=\""0\"" height=\""50\""\>") TextBox1.Text = ipRegEx.Match(httpContent).Groups("url").ToString() |
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »stevy« (6. Januar 2011, 14:25)

|
|
Quellcode |
1 |
<img src="(?<url>.*?)" width="123" border="0" height="50"> |