Browse Source

账号存本地

tags/录制修改前
zhangxueyang 4 years ago
parent
commit
1502433b7c
2 changed files with 11 additions and 0 deletions
  1. 4
    0
      XHWK.WKTool/App.cs
  2. 7
    0
      XHWK.WKTool/LoginWindow.xaml.cs

+ 4
- 0
XHWK.WKTool/App.cs View File

72
         /// </summary>
72
         /// </summary>
73
         public static string[] OutPut = new string[] { };
73
         public static string[] OutPut = new string[] { };
74
         public static string CameraPosition = string.Empty;
74
         public static string CameraPosition = string.Empty;
75
+        /// <summary>
76
+        /// 数据存放目录
77
+        /// </summary>
78
+        public static string DataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\XHMicroLesson\\"; 
75
         #region 点阵笔
79
         #region 点阵笔
76
         /// <summary>
80
         /// <summary>
77
         /// 点阵笔
81
         /// 点阵笔

+ 7
- 0
XHWK.WKTool/LoginWindow.xaml.cs View File

1
 using Common.system;
1
 using Common.system;
2
 using System;
2
 using System;
3
 using System.Configuration;
3
 using System.Configuration;
4
+using System.Text;
4
 using System.Windows;
5
 using System.Windows;
5
 using XHWK.WKTool.DAL;
6
 using XHWK.WKTool.DAL;
6
 
7
 
73
             int code = @interface.Login(accountNumber, password);
74
             int code = @interface.Login(accountNumber, password);
74
             if(code==0)
75
             if(code==0)
75
             {
76
             {
77
+                FileToolsCommon.CreateDirectory(APP.DataPath);
78
+                string applicationData = APP.DataPath + "accountNumber.txt";
79
+                string accountNumbers = DateTime.Now.ToLongDateString().ToString();//当前时间 
80
+                System.IO.File.WriteAllText(applicationData, accountNumbers, Encoding.Default);//存放签名验证日期
81
+
82
+
76
                 UpdateSettingString("userName", txbAccountNumber.Text);
83
                 UpdateSettingString("userName", txbAccountNumber.Text);
77
                 APP.IsLoginType = true;
84
                 APP.IsLoginType = true;
78
                 txbAccountNumber.Text = string.Empty;
85
                 txbAccountNumber.Text = string.Empty;

Loading…
Cancel
Save