Hallo Leute
Ich Speicher den Cookie und möchte aus diesen dann die sid (Session Id) auslesen.
Damit ich diese später in mein eigenen Browser laden kann.
Nur leider Bekomme ich nur, den ganzen Queltext ausgelesen, und nicht nur den sid.
Was mache ich falsh?
Habe mich noch nie mit Cookies ausernander gesetzt, bitte um hilfe.
Debug.Print(SetCookie.name)
gibt aus..
dosid
BP_DO_tracking_viewToReg_view
bpLandingPage_fallback
Debug.Print(SetCookie.value)
d8df2c464e2e31ab10639140a73a35c4
1
darkorbit.com/
nur wie lade ich die value 2 aus dem cookie in meinem link?
Lg an alle
Ich Speicher den Cookie und möchte aus diesen dann die sid (Session Id) auslesen.
Damit ich diese später in mein eigenen Browser laden kann.
Nur leider Bekomme ich nur, den ganzen Queltext ausgelesen, und nicht nur den sid.
Was mache ich falsh?
Habe mich noch nie mit Cookies ausernander gesetzt, bitte um hilfe.
VB.NET-Quellcode
- Imports System
- Imports System.Net
- Imports System.IO
- Imports System.Text
- Imports System.Text.RegularExpressions
- Public Class LoginForm1
- Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
- If UsernameTextBox.Text = "" Then
- MsgBox("Name eintippen")
- ElseIf PasswordTextBox.Text = "" Then
- MsgBox("Password eintippen")
- Else
- Dim URL = "http://www.darkorbit.com"
- Dim Request As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
- Request.Method = "POST"
- Request.ContentType = "application/x-www-form-urlencoded"
- Dim Post As String = "loginForm_default_username=" & UsernameTextBox.Text & "&loginForm_default_password=" & PasswordTextBox.Text & "&loginForm_default_login_submit=Login"
- Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
- Request.ContentLength = byteArray.Length
- Dim DataStream As Stream = Request.GetRequestStream()
- DataStream.Write(byteArray, 0, byteArray.Length)
- DataStream.Close()
- Dim Response As HttpWebResponse = Request.GetResponse()
- DataStream = Response.GetResponseStream()
- Dim reader As New StreamReader(DataStream)
- Dim ServerResponse As String = reader.ReadToEnd()
- Dim Request2 As HttpWebRequest = HttpWebRequest.Create(URL)
- Request2.CookieContainer = New CookieContainer()
- Dim Response2 As HttpWebResponse = Request2.GetResponse
- Response2.Cookies = Request2.CookieContainer.GetCookies(Request2.RequestUri)
- Dim Reader2 As IO.StreamReader = New IO.StreamReader(Response2.GetResponseStream)
- For Each SetCookie As Cookie In Response2.Cookies
- Debug.Print(SetCookie.Value)
- Next
- reader.Close()
- DataStream.Close()
- Response.Close()
- If InStr(ServerResponse, "Serverauswahl") Then
- MessageBox.Show("Login OK")
- Form2.Show()
- Me.Hide()
- Dim URL2 = ComboBox1.SelectedItem & ".darkorbit.bigpoint.com/indexInternal.es?action=internalStart&dosid="
- Form2.WebBrowser1.Navigate(URL2)
- Form2.RichTextBox2.Text = (URL2)
- Dim path As String = "settings\"
- Dim file As System.IO.FileStream
- If Not System.IO.File.Exists(path & UsernameTextBox.Text & ".pixy") Then
- file = System.IO.File.Create(path & UsernameTextBox.Text & ".pixy")
- file.Close()
- Dim writeFile As System.IO.TextWriter = New _
- StreamWriter(path & UsernameTextBox.Text & ".pixy")
- writeFile.Write(UsernameTextBox.Text & ";" & PasswordTextBox.Text & ";" & ComboBox1.SelectedItem)
- writeFile.Flush()
- writeFile.Close()
- Return
- ElseIf System.IO.File.Exists(path & UsernameTextBox.Text & ".pixy") Then
- Dim writeFile As System.IO.TextWriter = New _
- StreamWriter(path & UsernameTextBox.Text & ".pixy")
- writeFile.Write(UsernameTextBox.Text & ";" & PasswordTextBox.Text & ";" & ComboBox1.SelectedItem)
- writeFile.Flush()
- writeFile.Close()
- Return
- End If
- Else
- MessageBox.Show("Login nicht OK")
- End If
- End If
- End Sub
- Private Sub Cancel_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
- Me.Close()
- End Sub
- Private Sub ComboBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.VisibleChanged
- ComboBox2.Items.AddRange(System.IO.Directory.GetFiles("settings\", "*.pixy").ToArray)
- End Sub
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If ComboBox2.SelectedIndex = -1 Then
- MessageBox.Show("Du mus eine Login datei Auswählen")
- Else
- Dim path As String = "settings\"
- Dim ReadFile As System.IO.TextReader = New _
- StreamReader(path & "seby1302.pixy")
- ReadFile.Close()
- Return
- End If
- End Sub
- End Class
Debug.Print(SetCookie.name)
gibt aus..
dosid
BP_DO_tracking_viewToReg_view
bpLandingPage_fallback
Debug.Print(SetCookie.value)
d8df2c464e2e31ab10639140a73a35c4
1
darkorbit.com/
nur wie lade ich die value 2 aus dem cookie in meinem link?
Lg an alle
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „seby1302“ ()