以下陈述不应该是自动更新的吗?我在执行查询后尝试删除文件时出现IOException.
using (SQLiteConnection connection = new SQLiteConnection("Data Source=" + AppDomain.CurrentDomain.BaseDirectory + "data\\test.db;Version=3;"))
{
connection.Open();
SQLiteCommand command = new SQLiteCommand("CREATE TABLE IF NOT EXISTS test (id INTEGER)", connection);
command.ExecuteNonQuery();
}
//throwing an IOException
File.Delete(AppDomain.CurrentDomain.BaseDirectory + "data\\test.db");
Run Code Online (Sandbox Code Playgroud)
我迟到了,但我不得不:
GC.WaitForPendingFinalizers();
GC.Collect();
Run Code Online (Sandbox Code Playgroud)
在调用File.Delete()之前.
| 归档时间: |
|
| 查看次数: |
2030 次 |
| 最近记录: |