Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class vBulletin
- Inherits Forum
- Public Sub New(ByVal url As String, ByVal username As String, _
- ByVal password As String)
- MyBase.New(url, url & "/login.php?do=login", username, "vbseo_loggedin", "yes")
- MyBase.logindata = "vb_login_username=" + username + "&vb_login_password=" + password + _
- "&cookieuser=1&s=&securitytoken=guest&do=login&vb_login_md5password=" + Md5String(password) + _
- "&vb_login_md5password_utf=" + Md5String(password)
- End Sub
- Public Overrides Function isLoggedIn(ByVal cookies As System.Net.CookieContainer) As Boolean
- If Not IsNothing(cookies.GetCookies(New Uri(url)).Item(defaultCookieName)) Then
- If cookies.GetCookies(New Uri(url)).Item(defaultCookieName).Value.Contains(defaultCookieSearch) Then
- Return True
- End If
- End If
- Return False
- End Function
- Private Function Md5String(ByVal v As String) As String
- Dim myProv As New System.Security.Cryptography.MD5CryptoServiceProvider
- Dim b As Byte() = System.Text.Encoding.ASCII.GetBytes(v)
- b = myProv.ComputeHash(b)
- Dim str As String = ""
- Dim i As Integer
- For i = 0 To b.Length - 1
- str = (str & b(i).ToString("x2").ToLower)
- Next i
- Return str
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement