Webseite mit .htaccess lesen und in Textbox anzeigen

  • VB.NET

Es gibt 8 Antworten in diesem Thema. Der letzte Beitrag () ist von livius91.

    Webseite mit .htaccess lesen und in Textbox anzeigen

    Hallo,

    wie im Thread angegeben, suche ich verzweifelt nach lösungen.



    Dim wc As New Net.WebClient
    wc.Credentials = New Net.NetworkCredential("user", "pw")
    Dim Quelltext = wc.DownloadString("http://ip:port")
    msgbox(Quelltext) Wie geht es weiter?



    1. Warum 4 Zitate und 3 davon leer?
    2. Warum Zitate und kein VB-Tag ([code=vbnet]'Code[/code])
    3. Bitte was ist deine Frage ?

    EDIT: Sorry, hab nicht gesehen, dass das dein erster Beitrag ist. Willkommen im Forum und sehe das oben als Tipp ^^
    »There's no need to "teach" atheism. It's the natural result of education without indoctrination.« — Ricky Gervais
    Hallo,

    ja das mit dem Zitat habe ich spät gesehen. SORRY.


    Quellcode

    1. <HTML><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1"><TITLE>Info pages</TITLE><BODY><H2>Welcome to My.Server</H2><input type="button" value="Home" onclick="parent.location='/'"><input type="button" value="Active Clients" onclick="parent.location='/activeclients'"><input type="button" value="Clients" onclick="parent.location='/clients'"><input type="button" value="Servers" onclick="parent.location='/servers'"><input type="button" value="Config" onclick="parent.location='/config'"><input type="button" value="Ping" onclick="parent.location='/Ping'"><input type="button" value="Mailsrv" onclick="parent.location='/Mailsrv'"><BR><BR>Current time 10:59:44<BR>Text<BR>Text<BR>Text<BR>Text<BR><BR>Text<BR>Text<BR></BODY></HTML>




    So hab das mit RichTextBox gemacht, klappt auch Super. Nun möchte ich gerne mein HTML Code filtern.

    Quellcode

    1. Quelltext = Quelltext.Replace("<HTML>", "")
    2. Quelltext = Quelltext.Replace("</HTML>", "") ...


    Ist schon mühsam alles zu replacen. Kann man dan evt. anders lösen ?


    mfg
    Hi,

    merke dass ich hier schon meine Probleme habe zu verstehen.
    Aber es kommt schonmal was ...


    Quellcode

    1. Dim pattern As String = "<([^>]+)" Dim replacement As String = " " Dim rgx As New Regex(pattern)
    2. Dim result As String = rgx.Replace(Quelltext, replacement) Me.RichTextBox1.Text = result



    Pattern muss ich jetzt feiner einstellen sonst funktioniert das auch.
    Wäre dieser Code schonmal sinnvoll einsetzbar?

    Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „livius91“ ()

    Hi,


    Quellcode

    1. <HTML><META HTTP-EQUIV="Pragma" CONTENT="no-cache"><META HTTP-EQUIV="Expires" CONTENT="-1"><TITLE>info pages</TITLE><BODY><H2>My Server</H2><input type="button" value="Home" onclick="parent.location='/'"><input type="button" value="Acs" onclick="parent.location='/ac'"><input type="button" value="Clients" onclick="parent.location='/clients'"><input type="button" value="active" onclick="parent.location='/active'"><input type="button" value="Config" onclick="parent.location='/Config'"><input type="button" value="Ping" onclick="parent.location='/ping'"><input type="button" value="Ent" onclick="parent.location='/ent'"><BR><BR>time 17:03:07<BR>ID: e6a636e8a40efce8<BR>Uptime: 00d 17:27:17<BR>Connected : 3<BR>Active: 1<BR>Total: 3<BR>pingtime: 53<BR>Views: 3<BR></BODY></HTML>



    time....
    Uptime:
    Active:
    Connected:
    Total:
    pingtime:
    Views: