Hallo,
Ich bin dabei mir eine Dll zu schreiben und wollte da sganze mal testen beim aufruf meiner Httpwebrequest function kommt immer der fehler
"Object reference not set to an instance of an object."
kann mir jemand sagen wie ich das behoben bekomme ?
mfg
Ich bin dabei mir eine Dll zu schreiben und wollte da sganze mal testen beim aufruf meiner Httpwebrequest function kommt immer der fehler
"Object reference not set to an instance of an object."
kann mir jemand sagen wie ich das behoben bekomme ?
VB.NET-Quellcode
- Public Function questt(ByVal Met As String, ByVal Post As String, ByVal Site As String) As String
- Dim req As HttpWebRequest = CType(HttpWebRequest.Create(Site), HttpWebRequest)
- Dim byteArray() As Byte = Encoding.UTF8.GetBytes(Post)
- req.ContentLength = byteArray.Length
- req.CookieContainer = c
- req.UserAgent = "Mozilla/5.0 (Windows NT 6.1; rv:53.0) Gecko/20100101 Firefox/53.0"
- req.ContentType = "application/x-www-form-urlencoded"
- req.AllowAutoRedirect = True
- req.Method = Met
- If req.Method = "POST" Then
- Dim w As New StreamWriter(req.GetRequestStream(), System.Text.Encoding.Default)
- w.Write(Post)
- w.Close()
- Else
- Dim stream_in As StreamReader
- stream_in = New StreamReader(req.GetResponse.GetResponseStream())
- Dim k As String = stream_in.ReadToEnd
- stream_in.Close()
- Return k
- End If
- End Function
- Dim U As New ultimate.Class1
- Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
- If U.Youtube("username...", "passwort...") Then MessageBox.Show("success") Else MessageBox.Show("failed")
- End Sub
- Public Function Youtube(ByVal Email As String, ByVal Pass As String) As Boolean
- Dim post As String = questt("POST", "continue=https%3A%2F%2Fwww.youtube.com%2Fsignin%3Fapp%3Ddesktop%26action_handle_signin%3Dtrue%26next%3D%252F%26hl%3Den%26feature%3Dsign_in_button&identifier=" & Email & "&password=" & Pass & "&ca=&ct=: undefined", "https://accounts.google.com/signin/v2/challenge/password/empty")
- Return Not post.Contains("Sorry, something went wrong there. Try again.")
- End Function
mfg
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von „jabba191112“ ()