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

  • 相关阅读:
    centos7环境下搭建redis及springboot连接集成
    SSL配置及练习
    centos7 环境下 搭建mysql数据库
    centos7 集群免密码登录
    IDEA如何设置spring-boot-devtools即所见即所得
    GitHub之分支创建
    联机SSH访问本地虚机环境
    2.7.3版本hadoop之HDFS环境搭建之浅谈
    Idea 打包maven项目 以及spring boot 的自动配置
    VoLTE Spec 87 Documents
  • 原文地址:https://www.cnblogs.com/LuoEast/p/10818907.html
Copyright © 2011-2022 走看看