string dll32 = System.Windows.Forms.Application.StartupPath + @"\System.Data.SQLite-32.DLL";
            string dll64 = System.Windows.Forms.Application.StartupPath + @"\System.Data.SQLite-64.DLL";
            string dllpath = System.Windows.Forms.Application.StartupPath + @"\System.Data.SQLite.dll";
            string systemtype = string.Empty;
            systemtype = Detect32or64();
            if (systemtype == "32" || systemtype == string.Empty)
            {
                try
                {
                    using (FileStream fs = File.Create(dllpath)) {; }
                    File.Copy(dll32, dllpath, true);
                }
                catch
                {
                    ;
                }
            }
            else if (systemtype == "64")
            {
                try
                {
                    using (FileStream fs = File.Create(dllpath)) { }
                    File.Copy(dll64, dllpath, true);
                }
                catch
                {
                    ;
                }
            }

 

 

 

 

private static string Detect32or64()
        {
            switch (IntPtr.Size)
            {
                case 8:
                    return "64";
                default:
                    return "32";
            }
        }

相关文章:

  • 2022-02-16
  • 2021-12-15
  • 2022-02-17
  • 2022-12-23
  • 2022-12-23
  • 2021-10-01
  • 2021-11-12
  • 2021-05-29
猜你喜欢
  • 2021-05-27
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-12-23
相关资源
相似解决方案