Last active
December 20, 2015 23:08
-
-
Save JmPotato/6209776 to your computer and use it in GitHub Desktop.
Minecraft 正版验证
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
label7.Text = "登录中..."; | |
string url = "https://login.minecraft.net/?user=" + Program.username + "&password=" + password + "&version=13"; | |
WebClient client = new WebClient(); | |
Stream data = client.OpenRead(url); | |
StreamReader reader = new StreamReader(data); | |
string s = reader.ReadToEnd(); | |
Console.WriteLine(s); | |
data.Close(); | |
reader.Close(); | |
string[] loginResult = s.Split(':'); | |
Program.login_parameter = "\"" + loginResult[2] + "\" \"" + loginResult[3] + "\""; | |
Program.login = true; | |
label7.Text = "已登录"; | |
MessageBox.Show("验证成功!"); | |
} | |
catch (Exception) | |
{ | |
MessageBox.Show("验证失败!请确认用户名或密码正确!"); | |
label7.Text = "登录失败"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment