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)
GetWrapperCode:Public Wrapper As New Wrapper
PostWrapperCode:strHTML = Wrapper.GetWrapper("www.gaiaonline.com")
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.Code:strHTML = Wrapper.PostWrapper("www.gaiaonline.com/auth/", strPostData)
Download TEMPTii's Wrapper
Code:http://www.megaupload.com/?d=8CM56ILH
Code Snippits
Gaiaonline Login Function
How to use:Code: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 Function
Code:If GaiaonlineLogin(txtUsername, txtPassword) = True Then MsgBox("Login successful.") ElseIf GaiaonlineLogin(txtUsername, txtPassword = False then MsgBox("Login failed.") End If
Results 1 to 13 of 13
Thread: [VB.Net] TEMPTii's Wrapper
Threaded View
- 06 Aug. 2010 03:20am #1
Error: Title Not Found
- Age
- 29
- Join Date
- Dec. 2009
- Location
- Hell
- Posts
- 2,248
- Reputation
- 248
- LCash
- 0.00
[VB.Net] TEMPTii's Wrapper
Last edited by TEMPTii; 06 Aug. 2010 at 04:17pm.