好友
阅读权限10
听众
最后登录1970-1-1
|
如题求助!有大神帮忙看看如何能跳过登陆直接打开软件
private void btn_login_Click(object sender, EventArgs e)
{
this.SecretCode = this.tbSecret.Text.Trim();
string accountCode = this.AccountCode;
if ((accountCode == null) || (accountCode.Length == 0))
{
MessageBox.Show("请输入账号");
}
else if ((this.SecretCode == null) || (this.SecretCode.Length == 0))
{
MessageBox.Show("请输入密码");
}
else
{
this.btn_login.Enabled = false;
this.btn_cancel.Enabled = false;
string str2 = MD5Stream(this.SecretCode);
this.tipBox.Show();
string str4 = MD5Stream(accountCode + ComputerInfo.GetRequestCode());
string url = "http://cad.pi.com/cad/member/encryption";
IDictionary<string, string> parameters = new Dictionary<string, string> {
{
"userAccount",
accountCode
},
{
"password",
str2
},
{
"requestCount",
str4
}
};
HttpWebResponse webresponse = CreatePostHttpResponse(url, parameters, 0x1770, null, null);
if (webresponse == null)
{
MessageBox.Show("请求出错, 请检查网络");
}
else
{
ResModel model = JsonHelper.ParseFromJson<ResModel>(GetResponseString(webresponse));
if (model.code == "0")
{
this.IsValibleCode = "OK";
MessageBox.Show("登录成功!");
try
{
XElement rootNode = UserConfig.RootNode;
if (rootNode == null)
{
return;
}
rootNode.ChildElement("Settings").SetNodeValue("UserName", accountCode);
rootNode.Save(UserConfig.ConfigFile);
}
catch
{
}
base.DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show(model.msg);
}
}
this.tipBox.Hide();
this.btn_login.Enabled = true;
this.btn_cancel.Enabled = true;
}
}
0 0x0private void btn_login_Click(object sender, EventArgs e)
{
this.SecretCode = this.tbSecret.Text.Trim();
string accountCode = this.AccountCode;
if ((accountCode == null) || (accountCode.Length == 0))
{
MessageBox.Show("请输入账号");
}
else if ((this.SecretCode == null) || (this.SecretCode.Length == 0))
{
MessageBox.Show("请输入密码");
}
else
{
this.btn_login.Enabled = false;
this.btn_cancel.Enabled = false;
string str2 = MD5Stream(this.SecretCode);
this.tipBox.Show();
string str4 = MD5Stream(accountCode + ComputerInfo.GetRequestCode());
string url = "http://cad.smartmrop.com/cad/member/encryption";
IDictionary<string, string> parameters = new Dictionary<string, string> {
{
"userAccount",
accountCode
},
{
"password",
str2
},
{
"requestCount",
str4
}
};
HttpWebResponse webresponse = CreatePostHttpResponse(url, parameters, 0x1770, null, null);
if (webresponse == null)
{
MessageBox.Show("请求出错, 请检查网络");
}
else
{
ResModel model = JsonHelper.ParseFromJson<ResModel>(GetResponseString(webresponse));
if (model.code == "0")
{
this.IsValibleCode = "OK";
MessageBox.Show("登录成功!");
try
{
XElement rootNode = UserConfig.RootNode;
if (rootNode == null)
{
return;
}
rootNode.ChildElement("Settings").SetNodeValue("UserName", accountCode);
rootNode.Save(UserConfig.ConfigFile);
}
catch
{
}
base.DialogResult = DialogResult.OK;
}
else
{
MessageBox.Show(model.msg);
}
}
this.tipBox.Hide();
this.btn_login.Enabled = true;
this.btn_cancel.Enabled = true;
}
}
|
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|