System.AppContext.BaseDirectory 指放在当前项目下
var dbPath = Path.Combine(System.AppContext.BaseDirectory, “MyDatabase.db”);
//创建数据文件
SQLiteConnection.CreateFile(dbPath);
打开数据连接
m_dbConnection = new SQLiteConnection(@”Data Source=”+ dbPath + “;Version=3;”);
m_dbConnection.Open();
- 本文来源链接地址: https://www.npspro.top/335.html