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

  • 相关阅读:
    防窜货下加密锁使用常见问题
    SQL Server 2000/2005/2008 触发器的管理和查看
    列表显示时,部分凭证会分两行显示,且不能删除
    JDBC 连接 带实例名的SQL Server
    登录软件提示:读取数据源出现错误,pkcs7填充无效,无法被移除
    完美卸载SQL Server 2008的方案
    彻底卸载(删除)SQL server2000
    NCV5取消:授权数到达,或者许可证过期提示的秘诀
    SQL Server日志清空方法 .
    第二天 一列布局
  • 原文地址:https://www.cnblogs.com/LuoEast/p/10818907.html
Copyright © 2011-2022 走看看