Pārlūkot izejas kodu

账号存本地

tags/录制修改前
zhangxueyang pirms 4 gadiem
vecāks
revīzija
1502433b7c
2 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 4
    0
      XHWK.WKTool/App.cs
  2. 7
    0
      XHWK.WKTool/LoginWindow.xaml.cs

+ 4
- 0
XHWK.WKTool/App.cs Parādīt failu

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

+ 7
- 0
XHWK.WKTool/LoginWindow.xaml.cs Parādīt failu

@@ -1,6 +1,7 @@
1 1
 using Common.system;
2 2
 using System;
3 3
 using System.Configuration;
4
+using System.Text;
4 5
 using System.Windows;
5 6
 using XHWK.WKTool.DAL;
6 7
 
@@ -73,6 +74,12 @@ namespace XHWK.WKTool
73 74
             int code = @interface.Login(accountNumber, password);
74 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 83
                 UpdateSettingString("userName", txbAccountNumber.Text);
77 84
                 APP.IsLoginType = true;
78 85
                 txbAccountNumber.Text = string.Empty;

Notiek ielāde…
Atcelt
Saglabāt