|
@@ -1,6 +1,7 @@
|
1
|
1
|
using Common.system;
|
2
|
2
|
using System;
|
3
|
3
|
using System.Configuration;
|
|
4
|
+using System.IO;
|
4
|
5
|
using System.Text;
|
5
|
6
|
using System.Windows;
|
6
|
7
|
using XHWK.WKTool.DAL;
|
|
@@ -23,11 +24,21 @@ namespace XHWK.WKTool
|
23
|
24
|
}
|
24
|
25
|
public void Initialize()
|
25
|
26
|
{
|
26
|
|
- if (GetSettingString("isRemind").Equals("True"))
|
|
27
|
+
|
|
28
|
+ if (FileToolsCommon.IsExistFile(APP.DataPath + "accountNumber.txt"))
|
27
|
29
|
{
|
28
|
|
- ckSaveName.IsChecked = true;
|
29
|
|
- txbAccountNumber.Text = GetSettingString("userName");
|
|
30
|
+ string accountNumber = System.IO.File.ReadAllText(APP.DataPath + "accountNumber.txt", Encoding.Default);
|
|
31
|
+ if(!string.IsNullOrWhiteSpace(accountNumber))
|
|
32
|
+ {
|
|
33
|
+ txbAccountNumber.Text = accountNumber;
|
|
34
|
+ ckSaveName.IsChecked = true;
|
|
35
|
+ }
|
30
|
36
|
}
|
|
37
|
+ //if (GetSettingString("isRemind").Equals("True"))
|
|
38
|
+ //{
|
|
39
|
+ // ckSaveName.IsChecked = true;
|
|
40
|
+ // txbAccountNumber.Text = GetSettingString("userName");
|
|
41
|
+ //}
|
31
|
42
|
}
|
32
|
43
|
/// <summary>
|
33
|
44
|
/// 关闭事件
|
|
@@ -76,11 +87,20 @@ namespace XHWK.WKTool
|
76
|
87
|
{
|
77
|
88
|
FileToolsCommon.CreateDirectory(APP.DataPath);
|
78
|
89
|
string applicationData = APP.DataPath + "accountNumber.txt";
|
79
|
|
- string accountNumbers = DateTime.Now.ToLongDateString().ToString();//当前时间
|
80
|
|
- System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放签名验证日期
|
|
90
|
+ if (ckSaveName.IsChecked==true)
|
|
91
|
+ {
|
|
92
|
+
|
|
93
|
+ string accountNumbers = txbAccountNumber.Text;
|
|
94
|
+ System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
|
|
95
|
+ }
|
|
96
|
+ else
|
|
97
|
+ {
|
|
98
|
+ string accountNumbers = "";
|
|
99
|
+ System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放账号
|
|
100
|
+ }
|
81
|
101
|
|
82
|
102
|
|
83
|
|
- UpdateSettingString("userName", txbAccountNumber.Text);
|
|
103
|
+ //UpdateSettingString("userName", txbAccountNumber.Text);
|
84
|
104
|
APP.IsLoginType = true;
|
85
|
105
|
txbAccountNumber.Text = string.Empty;
|
86
|
106
|
pobPassword.Password = string.Empty;
|
|
@@ -122,14 +142,14 @@ namespace XHWK.WKTool
|
122
|
142
|
/// <param name="e"></param>
|
123
|
143
|
private void CkSaveName_Click(object sender, RoutedEventArgs e)
|
124
|
144
|
{
|
125
|
|
- if (ckSaveName.IsChecked == false)
|
126
|
|
- {
|
127
|
|
- UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
|
128
|
|
- }
|
129
|
|
- else
|
130
|
|
- {
|
131
|
|
- UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
|
132
|
|
- }
|
|
145
|
+ //if (ckSaveName.IsChecked == false)
|
|
146
|
+ //{
|
|
147
|
+ // UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
|
|
148
|
+ //}
|
|
149
|
+ //else
|
|
150
|
+ //{
|
|
151
|
+ // UpdateSettingString("isRemind", ckSaveName.IsChecked.ToString());
|
|
152
|
+ //}
|
133
|
153
|
}
|
134
|
154
|
/// <summary>
|
135
|
155
|
/// 读取客户设置
|