Hello I am new to Logical Gamers, and i wanted to share my basic VB.Net HttpWrapper.
I'm a newbie coder and have been attempting Gaiaonline's login, haven't succeeded yet but im still giving it a try.
Anyway here is my wrapper class: TinyUpload.com - best file hosting solution, with no limits, totaly free
May need Imports:
Usage Example:Code:Imports System.IO, System.Net
Let me know if there is anything you want me to add or have any suggestions.Code:Dim Wrapper As New Wrapper() dim html as string '(HTML AS RESPONSE, URL, METHOD, POSTdata, Refferer) Wrapper.Webrequest(html, "Http://www.blah.com", POST, "data+data+data", "") Wrapper.Webrequest(html, "Http://www.blah.com", GET, "", "")
Results 1 to 12 of 12
Thread: VB.Net HTTP Wrapper by Kitsune.
- 28 Mar. 2013 12:37am #1
VB.Net HTTP Wrapper by Kitsune.
- 28 Mar. 2013 01:22am #2
Looks alright if you're new If you need help with anything (i.e. login), feel free to ask. We're a pretty friendly and helpful bunch
- 28 Mar. 2013 01:48am #3
I hope you aren't the Kitsune i think you are
- 28 Mar. 2013 01:55am #4
- 28 Mar. 2013 02:14am #5
Yeah, don't think it's Izaya/Flame.
Apologies for derailing your thread, OP.
- 28 Mar. 2013 02:37am #6
No, im not anyone else.
Figures some one else would use Kitsune ><
Also, @Artificial i'm looking at Stapled's C# gaia login, but it's hard for me to understand and if i try to add an if-else i get some error in visual studio that says "Unreachable code".
- 28 Mar. 2013 02:41am #7
Post your code. It sounds like you're creating (possible a set of) conditions that will never evaluate to true.
- 28 Mar. 2013 02:48am #8Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { public static Boolean GaiaLogin(string username, string password) { HttpInterface wrapper = new HttpInterface(); Console.WriteLine("Logging"); string pd = StringExtensions.gsb((wrapper.get("http://www.gaiaonline.com/")), "</fieldset>", "</form>").Replace("data-value", ""); List<string> n = StringExtensions.gasb(pd, "name=\"", "\""); List<string> v = StringExtensions.gasb(pd, "value=\"", "\""); string postdata = n[0] + "=" + v[0] + "&" + n[1] + "=" + v[1] + "&" + n[2] + "=" + v[2] + "&" + n[3] + "=" + v[3] + "&" + "username=" + username + "&password=" + password; string login = wrapper.post("http://www.gaiaonline.com/auth/login/", postdata); login = wrapper.get("http://www.gaiaonline.com/"); return login.Contains("Welcome back"); <--------- Want to Add Something here, but i get error as described before ---------> } static void Main(string[] args) { GaiaLogin("******", "******"); <----- Account Details } } }
Code:if (login.Contains("Welcome back")) { Console.WriteLine("Pass"); } else Console.WriteLine("Fail"); }
- 28 Mar. 2013 02:57am #9
Put if (login.Contains("Welcome back")) { Console.WriteLine("Pass"); } else Console.WriteLine("Fail"); }
or whatever your code is before the return login.Contains("welcome back")
Return also signifies the end of a function or procedure. At least in most languages. See if something like that works. If not I'm probably overlooking another error in your code.
- 28 Mar. 2013 03:20am #10
Ah! Thank you for that information, i got it trk; however i have a lot of C# learning i need to do before i can compile a decent program but i suppose i'm one step closer.
I wish i could effectively convert everything into VB.NET (including chad's String Extensions) but i end up getting tons of errors i cant fix.
- 28 Mar. 2013 05:02am #11
There aren't really significant differences in VB.NET and C# syntactically. Both are powered by the underlying .NET Framework.
So porting the code shouldn't be too hard if you can read basic code and know a bit about the .NET libraries.
Anyway, if you need any help feel free to ask here and I'm sure someone will assist you.
- 28 Mar. 2013 05:11am #12
Moderator Bachelor of Science in Virginity
- Age
- 31
- Join Date
- Nov. 2009
- Location
- Toronto
- Posts
- 5,421
- Reputation
- 546
- LCash (Rank 3)
- 1.96