c#.net看不懂,求指教
private void btsign_Click(object sender, RoutedEventArgs e)
{
string usernum = UserNum.Text.ToString();
if (usernum.Length <= 0)
return;
string cmdtxt = "select User_Num from T_User where User_Num='" + usernum + "'";
DataTable table = new DataTable();
table = SqlHelper.ExecuteDataTable(cmdtxt);
if (table.Rows.Count <= 0)
MessageBox.Show("用户名不存在!");
else
{
if(remusername!=usernum)
{
Configuration cfa = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
cfa.AppSettings.Settings["usernum"].Value = usernum;
cfa.Save();
ConfigurationManager.RefreshSection("appSettings");
}
Online newwind = new Online(usernum);
newwind.Show();
this.Close();
}
}
最佳答案
哪些代码不明白
追问:
this.Visibility = Visibility.Visible; this.WindowState = WindowState.Normal; 追答:
this.Visibility 这句应该是设置窗口或控件的显示状态this.WindowState 这句是设置窗口的状态
追问:
已经解决了,谢谢
其他回答
其它网友回答:
哪里不懂呢
追问:
已经解决了,谢谢
其它网友回答:
有什么问题?这是根据 user_num 来读取数据库的记录并且显示
追问:
大概轮廓知道,wpf做的嘛,现在就是 不理解代码是什么意思