Example #1
0
        //登陆按钮
        private void LoginNet(object sender, RoutedEventArgs e)
        {
            //获取账号密码ip
            string nip = TextIp.Text;
            string uid = TextUid.Text;
            string pwd = TextPwd.Password;

            //获取登陆IP
            if (GetIp.IsChecked == true)
            {
                TextIp.Text = CsuNet.LoginIP();
                nip         = TextIp.Text;
            }
            //保存IP,账号和密码
            if (TextIp.Text != null & TextIp.Text != "")
            {
                Setting.UpdateSetting("nip", nip);
            }
            if (SaveUid.IsChecked == true)
            {
                Setting.UpdateSetting("uid", uid);
            }
            if (SavePwd.IsChecked == true)
            {
                Setting.UpdateSetting("pwd", pwd);
            }

            var relust = CsuNet.LoginCsuNet(nip, uid, pwd);

            MessageBox.Show(relust);
        }
Example #2
0
        //注销按钮
        private void LogoutNet(object sender, RoutedEventArgs e)
        {
            string nip = TextIp.Text;

            var relust = CsuNet.LogoutCsuNet(nip);

            MessageBox.Show(relust);
        }