public static async Task <bool> Logout(this IS1Client client, string formhash) { var result = await client.PostDataTaskAsync(new Uri(string.Format("{0}&formhash={1}", logoutUrl, formhash))); var user = DZUser.FromJson(result); return(user.Message.Messageval == loginSucceed || user.Message.Messageval == loginSucceedMobile); }
public static async Task <UserVariables> Login(this IS1Client client, string account, string pass, int loginType = 0) { client.AddPostParam(stepKey, stepValue); //client.AddPostParam(loginTypeKey, loginType); client.AddPostParam(userKey, account); client.AddPostParam(passKey, pass); var result = await client.PostDataTaskAsync(new Uri(loginUrl)); var user = DZUser.FromJson(result); if (user.Message.Messageval != loginSucceed && user.Message.Messageval != loginSucceedMobile) { throw new LoginException(user.Message.Messagestr, account, pass); } return(user.Variables); }