/// <summary> /// 成功返回登陆用户名,失败返回null /// </summary> private string loginYongYou() { Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); String userKey = cfa.AppSettings.Settings["userKey"].Value; String pswKey = cfa.AppSettings.Settings["pswKey"].Value; string result = YongYouHandler.userLogin(userKey, pswKey); return(result); }
private void login() { updateStatusStripLeft("正在登陆……"); Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); String userKey = cfa.AppSettings.Settings["userKey"].Value; String pswKey = cfa.AppSettings.Settings["pswKey"].Value; string result = YongYouHandler.userLogin(userKey, pswKey); if (result != null) { updateStatusStripRight("欢迎您," + result); } else { MessageBox.Show("登录失败,请检查"); this.Close(); } }