zoukankan      html  css  js  c++  java
  • C# 32位系统与64位系统调用不同的DLL文件


                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";
                }
            }

  • 相关阅读:
    C++中类模板的概念和意义
    C++中模板类声明和实现能否分离?
    C/C++ 关于大小端模式,大小端字节序转换程序
    C++中的赋值操作符重载和拷贝构造函数
    C++中的友元
    C/C++内存对齐详解
    C++ 虚函数表、函数地址、内存布局解析
    虚析构函数的必要性(C++)
    C++中的抽象类和接口
    C++中的单例类模板
  • 原文地址:https://www.cnblogs.com/LuoEast/p/10818907.html
Copyright © 2011-2022 走看看