Well you can use this since its a vbulletin forum.
Its in Vb.net but theres loads of converters
This is for module code
Code:
Imports System.Security.Cryptography
Imports System.Text
Imports System.Net
Imports System. I O
Module Module1
Public Function Login(ByVal Username As String, ByVal Password As String)
Password = MD5(Password)
Dim valid As Boolean = False
Dim data As String = "vb_login_username=" & Username & "&vb_login_password=&s=&do=login&vb_login_md5password=" & Password & "&vb_login_md5password_utf=" & Password
Try
Dim request As HttpWebRequest = WebRequest.Create("https://yoururlhere/login.php?do=login")
request.Method = WebRequestMethods.Http.Post
reques*****ntentType = "application/x-www-form-urlencoded"
request.UserAgent = "-- vBulletin Vaidation --"
reques*****ntentLength = data.Length
Dim rStream As New StreamWriter(request.GetRequestStream)
rStream.Write(data)
rStream.Flush()
rStream.Close()
Dim response As HttpWebResponse = request.GetResponse
Dim resReader As New StreamReader(response.GetResponseStream)
Dim str As String = resReader.ReadToEnd
If str.Contains("Thank you for logging in") Then
valid = True
Else
valid = False
End If
response.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error: MPGH.net - Login!", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
Return valid
End Function
Public Function MD5(ByVal number As String) As String
Dim ASCIIenc As New ASCIIEncoding
Dim strReturn As String = String.Empty
Dim ByteSourceText() As Byte = ASCIIenc.GetBytes(number)
Dim Md5Hash As New MD5CryptoServiceProvider
Dim ByteHash() As Byte = Md5Hash.ComputeHash(ByteSourceText)
For Each b As Byte In ByteHash
strReturn &= b.ToString("x2")
Next
Return strReturn
End Function
End Module
and to use it youd use this with a button, a combo box as the username field, and a textbox as the password field:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Login(ComboBox1.Text, TextBox2.Text) Then
MsgBox("Successfully Logged In! WELCOME!")
Me.Hide()
Form2.Show()
Else
MsgBox("Incorrect Username/Password")
End If
End Sub
Obviously remove the spaces in Imports System. I O
If you need any help let me know