private void button2_Click(object sender, EventArgs e) { NetworkCredential cred; WindowsSecurity.GetCredentialsVistaAndUp("Roblox Launcher BETA", "Login to ROBLOX", out cred, this); if (cred != null) { CookieAwareWebClient.LoginResponse resp = client.Login(cred); if (resp.Status != "OK") { TaskDialog dialog = new TaskDialog(); Console.WriteLine(resp.Raw); dialog.InstructionText = "Error"; dialog.Icon = TaskDialogStandardIcon.Error; dialog.Text = String.Format("An error occured while trying to log in: {0}({1})", GetRespError(resp.Status), resp.Status); dialog.StandardButtons = TaskDialogStandardButtons.Retry | TaskDialogStandardButtons.Cancel; if (dialog.Show() == TaskDialogResult.Retry) { button2_Click(sender, e); } return; } userInfo = resp.UserInfo; pictureBox1.ImageLocation = "http://www.roblox.com/Thumbs/Avatar.ashx?username="******"{0} ({1})", userInfo.UserName, userInfo.UserID); } }
private void button2_Click(object sender, EventArgs e) { NetworkCredential cred; WindowsSecurity.GetCredentialsVistaAndUp("Roblox Launcher BETA", "Login to ROBLOX", out cred, this); if (cred != null) { CookieAwareWebClient.LoginResponse resp = client.Login(cred); if(resp.Status != "OK") { TaskDialog dialog = new TaskDialog(); Console.WriteLine(resp.Raw); dialog.InstructionText = "Error"; dialog.Icon = TaskDialogStandardIcon.Error; dialog.Text = String.Format("An error occured while trying to log in: {0}({1})",GetRespError(resp.Status), resp.Status); dialog.StandardButtons = TaskDialogStandardButtons.Retry | TaskDialogStandardButtons.Cancel; if (dialog.Show() == TaskDialogResult.Retry) button2_Click(sender, e); return; } userInfo = resp.UserInfo; pictureBox1.ImageLocation = "http://www.roblox.com/Thumbs/Avatar.ashx?username="******"{0} ({1})", userInfo.UserName, userInfo.UserID); } }