Files
kou_zhaoxielou_shandong/口罩泄露定制款/Program.cs
2026-01-16 20:53:33 +08:00

43 lines
1.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
}
}
}
}