Posted 11 years ago
·
Author
Ok I got bored while working on Mesh Thief and needed a method to login to IMVU website at any given time on the fly so I wrote a basic webclient h4c|< that dose this for me with given login information
CookieClient.cs
How to Use:
Simple and clean now you can keep reusing cCookit to download information from IMVUs site
CookieClient.cs
public class CookieAwareWebClient : WebClient
{
private readonly CookieContainer _cookie = new CookieContainer();
protected override WebRequest GetWebRequest(Uri address)
{
WebRequest request = base.GetWebRequest(address);
if (request is HttpWebRequest)
{
(request as HttpWebRequest).CookieContainer = _cookie;
}
return request;
}
}
How to Use:
var cCookie = new CookieAwareWebClient();
var loginData = new NameValueCollection { { "avatarname", "IMVU Username" }, { "password", "IMVU Password" } };
cCookie.UploadValues("https://secure.imvu.com/login/login/", "POST", loginData);
Simple and clean now you can keep reusing cCookit to download information from IMVUs site