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

  • 相关阅读:
    数组与字符串中的关于截取的总结
    js函数哪些事
    BFC的基础理解及应用场景
    idea永久激活码20211107
    SpringBoot加载properties配置文件的顺序
    Java排序算法之归并排序
    sort与sorted排序
    自定义的迭代器之 生成器
    通过可迭代对象,迭代器,理解dict,list,filter,map,zip,dict,list之间的联系
    迭代器原理 、for循环原理、自定义一个迭代器
  • 原文地址:https://www.cnblogs.com/LuoEast/p/10818907.html
Copyright © 2011-2022 走看看