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

  • 相关阅读:
    Django之AJAX
    Django中的csrf相关装饰器
    Django的中间件及WSGI
    Django之Cookie和Session
    Django之ORM操作(重要)
    Django的View(视图)和路由系统
    Django之url上的include,URL命名和反向解析,命名空间
    Django中的tags,母版和继承,组件,静态文件相关,自定义simpletag和自定义inclusion_tag
    kvm 宿主机不兼容
    kvm io限制
  • 原文地址:https://www.cnblogs.com/LuoEast/p/10818907.html
Copyright © 2011-2022 走看看