public void Login(string email, string password) { Tokens tokens = new Tokens(DownloadString(_homeUri)); NameValueCollection login = new NameValueCollection { {"__LASTFOCUS", String.Empty}, {"__EVENTTARGET", String.Empty}, {"__EVENTARGUMENT", String.Empty}, {"__VIEWSTATE", tokens.ViewState}, {"__EVENTVALIDATION", tokens.EventValidation}, {"page$itemkey", String.Empty}, {"page$itemname", String.Empty}, {"page$loginemail", email}, {"page$loginpassword", password}, {"page$btnLogin", "Login"} }; UploadValues(_homeUri, "POST", login); }
public void UpdateCharacter(string id) { Tokens tokens = new Tokens(DownloadString(_gameUri)); NameValueCollection update = new NameValueCollection { { "__EVENTTARGET", string.Format("page$content$charlist$ctl{0}$charname", id) }, {"__EVENTARGUMENT", String.Empty}, {"__VIEWSTATE", tokens.ViewState}, {"__EVENTVALIDATION", tokens.EventValidation}, {"page$itemkey", String.Empty}, {"page$itemname", String.Empty}, {"page$content$tradecharlist", String.Empty} }; UploadValues(_gameUri, "POST", update); }