warezbb にログインするプログラムを試してみましたが、どういうわけか、問題が返されないか、何が問題なのかがわからないのではないかと思います。正しいログイン情報を入力しても、「else msgbox」が出てきました
Public Class Form1 'From the code in the provided picture, you missed this line
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Login(TextBox1.Text, TextBox2.Text) = True Then
MsgBox("you are logged in")
Else
MsgBox("Either password or username is incorrect , please try again")
End If
End Sub
Function Login(ByVal username As String, ByVal password As String)
Try
Dim webRequest As HttpWebRequest
webRequest = CType(Net.WebRequest.Create("http://www.warez-bb.org/login.php?redirect="), WebRequest)
webRequest.Method = "POST"
webRequest.Method = "application/x-www-form-urlencoded"""
Dim Byte1 As Byte() = Encoding.UTF8.GetBytes("username=" & username & "&password=" & password & "&autologin=on&redirect=&login=Log+in")
webRequest.ContentLength = Byte1.Length
Dim Stream As Stream = webRequest.GetRequestStream
Stream.Write(Byte1, 0, Byte1.Length)
Stream.Close()
Dim respond As HttpWebResponse = webRequest.GetResponse
Stream = respond.GetResponseStream
Dim reader As New StreamReader(Stream)
Dim ServerRespond As String = reader.ReadToEnd
reader.Close()
Stream.Close()
If InStr(ServerRespond, "You have successfully logged in") Then
Return True
End If
Catch ex As Exception
Return False
End Try
End Function
End Class