蒸汽授权

时间:2016-02-13 12:47:16

标签: c# steam

我试图获取授权的Steam页面的HTML代码,但我无法登录。 我的代码是

public string tryLogin(string EXP, string MOD, string TIME)
{
    var rsa = new RSA();
    string encryptedPass;
    rsa.Exponent = EXP;
    rsa.Modulus = MOD;
    encryptedPass = rsa.Encrypt(Pass);

    string reqString = "username=kasyjack&password=" + encryptedPass + "&emailauth=&kasyjackfriendlyname=&captchagid=&captcha_text=&emailsteamid=&rsatimestamp=" + TIME + "&remember_login=false";
    byte[] requestData = Encoding.UTF8.GetBytes(reqString);

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://store.steampowered.com/login/dologin/");
    request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
    request.ContentLength = requestData.Length;
    request.Host = "store.steampowered.com";
    request.Method = "POST";
    request.UserAgent = Http.ChromeUserAgent();
    request.CookieContainer = _CookieCont;

    using (Stream st = request.GetRequestStream())
        st.Write(requestData, 0, requestData.Length);

    HttpWebResponse response = (HttpWebResponse)request.GetResponse();
    StreamReader sr = new StreamReader(response.GetResponseStream());
    string RSAR = sr.ReadToEnd();
    return RSAR;
}

但响应消息是

{"success":false,"requires_twofactor":false,"clear_password_field":true,"captcha_needed":false,"captcha_gid":-1,"message":"Incorrect login."}

所有人都知道,登录有什么问题?需要你的帮助。

1 个答案:

答案 0 :(得分:1)

GitHub上的SteamBot存储库有一个关于如何通过他们的网站登录Steam的工作示例:link to method

这是一个解释整个过程的图(由我做出):

Steam Web Login