Requires;
HTTPWrapper Class
Very simple, get's the job done.PHP Code:
using System;
class LGAuth
{
public enum UGLevel
{
NONE,
BRONZE,
SILVER,
GOLD
}
private HTTPWrapper Wrapper = new HTTPWrapper();
public Boolean Login(String Username, String Password)
{
return ((Wrapper.post("http://forum.logicalgamers.com/login.php?do=login", "vb_login_username=" + Username + "&vb_login_password_hint=Password&vb_login_password=" + Password + "&s=&securitytoken=guest&do=login&vb_login_md5password=&vb_login_md5password_utf=")).IndexOf("Thank you for logging in,") > -1) ? true : false;
}
public Boolean isUG(UGLevel Input)
{
if (Input <= getUGLevel())
{
return true;
}
return false;
}
private UGLevel getUGLevel()
{
String Return = Wrapper.get("http://forum.logicalgamers.com/");
if (Return.IndexOf("http://forum.logicalgamers.com/underground-gold/") > -1)
{
return UGLevel.GOLD;
}
else if (Return.IndexOf("http://forum.logicalgamers.com/underground-silver/") > -1)
{
return UGLevel.SILVER;
}
else if (Return.IndexOf("http://forum.logicalgamers.com/underground-bronze/") > -1)
{
return UGLevel.BRONZE;
}
return UGLevel.NONE;
}
}
Example usage;
PHP Code:
LGAuth LG = new LGAuth();
if (LG.Login("USERNAME", "PASSWORD") && LG.isUG(LGAuth.UGLevel.SILVER))
{
// setTimer to revalidate.
}
Results 1 to 6 of 6
- 27 Dec. 2010 08:36pm #1
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 10.00
[Release - C#] LG Authentication Class
- 27 Dec. 2010 09:12pm #2
Nice dude i wanna use this sometime:p nothing i make is good enough.
- 22 Aug. 2011 08:33pm #3
- 23 Aug. 2011 01:58pm #4
- 27 Aug. 2011 09:55am #5
- 27 Aug. 2011 04:30pm #6