public Form1() { InitializeComponent(); //txtLogin.Text = "*****@*****.**"; try { PulsarSystem.IniFiles ii = new PulsarSystem.IniFiles("settings.ini"); txtLogin.Text = ii.GetValue("login"); } catch { } lbLog.Items.Clear(); this.setControlsState(false); }
private void btnLogin_Click(object sender, EventArgs e) { try { PulsarSystem.IniFiles ii = new PulsarSystem.IniFiles("settings.ini",true); ii.SetValue("login", txtLogin.Text); } catch { } ServiceMarunthon.ApiSoapClient soap = new ServiceMarunthon.ApiSoapClient(new BasicHttpBinding(),new EndpointAddress(Models.Globals.EndPointUrl)); this.setControlsState(false); try { int id = soap.Login(txtLogin.Text.Trim(), this.GetPasswordHash()); if (id>0) this.setControlsState(true); else MessageBox.Show("Incorrect login or password. Please try again."); } catch { MessageBox.Show("Can not connect to Marunthon.com. Check internet connection and try again"); } }