添加sqlite数据库记录信息
This commit is contained in:
commit
c6676266af
5 files changed
+535
-3
No files matched your search
@@ -5,6 +5,7 @@ using ForwardingServerUI.Class;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Reflection.PortableExecutable;
|
||||
using System.Text;
|
||||
using TouchSocket.Sockets;
|
||||
|
||||
@@ -26,10 +27,16 @@ namespace ForwardingServerUI
|
||||
[ObservableProperty]
|
||||
public static DataTable _userTable = new();
|
||||
|
||||
public static SqliteHelper SQLiteHelpers = null!; //定义数据库
|
||||
private readonly string DBAddress = Environment.CurrentDirectory + "\\DB\\DB.db"; //数据库路径
|
||||
public static DataTable ActionLog = new DataTable();
|
||||
public static readonly object TableLock = new object();
|
||||
|
||||
public async void Data()
|
||||
{
|
||||
SQLiteHelpers = new SqliteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
|
||||
_machineTable.Columns.Add("ID", typeof(string));
|
||||
_machineTable.Columns.Add("IP", typeof(string));
|
||||
_machineTable.Columns.Add("Start", typeof(int));
|
||||
@@ -38,7 +45,6 @@ namespace ForwardingServerUI
|
||||
_machineTable.Columns.Add("HeartbeatTime", typeof(string));
|
||||
_machineTable.Columns.Add("MachineVer", typeof(string));
|
||||
|
||||
|
||||
_userTable.Columns.Add("ID", typeof(string));
|
||||
_userTable.Columns.Add("IP", typeof(string));
|
||||
_userTable.Columns.Add("User", typeof(string));
|
||||
|
||||
Reference in new issue
Block a user