添加项目文件。
This commit is contained in:
42
口罩泄露定制款/Program.cs
Normal file
42
口罩泄露定制款/Program.cs
Normal file
@@ -0,0 +1,42 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using 口罩泄露测试仪控制系统_定制款.窗体;
|
||||
|
||||
namespace 口罩泄露定制款
|
||||
{
|
||||
internal static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 应用程序的主入口点。
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
|
||||
CopySqliteDll();
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new frm_Login());
|
||||
}
|
||||
|
||||
|
||||
public static void CopySqliteDll()
|
||||
{
|
||||
// 获取当前程序运行的位数(32位/64位)
|
||||
bool is64Bit = Environment.Is64BitProcess;
|
||||
string dllFolder = is64Bit ? "x64" : "x86";
|
||||
|
||||
// 源DLL路径(项目中的x86/x64文件夹)
|
||||
string sourcePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, dllFolder, "sqlite3.dll");
|
||||
// 目标路径(与程序同目录)
|
||||
string targetPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "sqlite3.dll");
|
||||
|
||||
// 如果目标路径没有DLL,或源DLL更新,则复制
|
||||
if (!File.Exists(targetPath) || File.GetLastWriteTime(sourcePath) > File.GetLastWriteTime(targetPath))
|
||||
{
|
||||
File.Copy(sourcePath, targetPath, overwrite: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user