[VB.Net] TEMPTii's Wrapper
I spent like 3 hours coding this stupid thing so you better not use it but say you did and plus rep me anyways. This is my version of the HTTP Wrapper since the one that everybody uses doesn't even work for me for who knows why. I wouldn't recommend this to those of you who have the standard wrapper working because of chronic GUI freezing, but if you don't use this. It works just as every other wrapper does but I'll show you how to use it anyways.
Pre-Declarations (Must put these before Class declared)
GetWrapper
PostWrapper
It's ok if you don't make the URL in URI format, it will automatically turn it into one with the handy URICheck function I made in conjunction with simple string combination coding. Tell me any bugs or functions I should add because since I don't have the standard wrapper, I can't check myself. To add to your project, add existing items of functions.vb and wrapper.vb and if you get the error regarding HTTPUtility, add the reference of system.web.dll to your project.
Download TEMPTii's Wrapper
Code Snippits
Gaiaonline Login Function
How to use:
Pre-Declarations (Must put these before Class declared)
Public Wrapper As New WrapperGetWrapper
strHTML = Wrapper.GetWrapper("www.gaiaonline.com")PostWrapper
strHTML = Wrapper.PostWrapper("www.gaiaonline.com/auth/", strPostData)It's ok if you don't make the URL in URI format, it will automatically turn it into one with the handy URICheck function I made in conjunction with simple string combination coding. Tell me any bugs or functions I should add because since I don't have the standard wrapper, I can't check myself. To add to your project, add existing items of functions.vb and wrapper.vb and if you get the error regarding HTTPUtility, add the reference of system.web.dll to your project.
Download TEMPTii's Wrapper
http://www.megaupload.com/?d=8CM56ILHCode Snippits
Gaiaonline Login Function
Public Function GaiaonlineLogin(ByVal username As String, ByVal password As String) As Boolean
Dim strHTML As String
Dim strPostData As String
strHTML = Wrapper.GetWrapper("www.gaiaonline.com/auth/")
strHTML = Replace(strHTML, """", "'")
strPostData = "token=" & _
GetStringBetween(strHTML, "<input type='hidden' name='token' value='", "' />") & "&sid=" & _
GetStringBetween(strHTML, "<input type='hidden' name='sid' value='", "' />") & "&redirect=" & _
System.Web.HttpUtility.UrlEncode(GetStringBetween(strHTML, "<input type='hidden' name='redirect' value='", "' />")) & "&username=" & _
System.Web.HttpUtility.UrlEncode(username) & "&password=" & _
password & "&chap="
strHTML = Wrapper.PostWrapper("www.gaiaonline.com/auth/login/", strPostData)
If strHTML.Contains("<title>Welcome to Gaia | Gaia Online</title>") = True Then
GaiaonlineLogin = True
ElseIf strHTML.Contains("<title>Welcome to Gaia | Gaia Online</title>") = False Then
GaiaonlineLogin = False
End If
End FunctionHow to use:
If GaiaonlineLogin(txtUsername, txtPassword) = True Then
MsgBox("Login successful.")
ElseIf GaiaonlineLogin(txtUsername, txtPassword = False then
MsgBox("Login failed.")
End If

