System.Net.WebException: 'The remote server returned an error: (403) Forbidden.'
private void signinBtn1_Click(object sender, EventArgs e) { //ResponseInformation.loginresponse.Failure is a boolean, which will will be true if login failed ResponseInformation.loginresponse = ClientFunctions.Login(userTB.Text, passTB.Text, ProgramInformation.ProgramId); //Here we set password so we can use them throughout the application ResponseInformation.Password = passTB.Text; if (ResponseInformation.loginresponse.Failure) { //Message will be the reason for failed login MessageBox.Show(ResponseInformation.loginresponse.Message, SafeGuardTitle.safeguardtitle); } else { //Message will be "Successfully Logged In" Properties.Settings.Default.Username = ResponseInformation.loginresponse.UserName; Properties.Settings.Default.Password = ResponseInformation.Password; Properties.Settings.Default.Save(); //this.Alert("Login Successful! Redirecting. . .", AlertForm.enmType.Success); MessageBox.Show($"Welcome{ResponseInformation.loginresponse.UserName}!\n" + (DateTime.Now.Date), SafeGuardTitle.safeguardtitle, MessageBoxButtons.OK, MessageBoxIcon.Information); this.Hide(); MainForm frmMain = new MainForm(); frmMain.ShowDialog(); this.Close(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)