zoukankan      html  css  js  c++  java
  • C#加载dll 创建类对象

    //加载dll 创建类对象
    string
    sqlightAssembly = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "system.data.sqlite.dll"); Assembly lib = Assembly.LoadFrom(sqlightAssembly); foreach (Type t in lib.GetExportedTypes()) { if(t.FullName == "System.Data.SQLite.SQLiteFactory") return (DbProviderFactory)Activator.CreateInstance(t); }
    //获取CPU类型
    private
    ProcessorType GetProcessorArch() { using (System.Management.ManagementClass processors = new System.Management.ManagementClass("Win32_Processor")) { foreach (System.Management.ManagementObject processor in processors.GetInstances()) { int AddressWidth = int.Parse(processor["AddressWidth"].ToString()); int Architecture = int.Parse(processor["Architecture"].ToString()); //See Win32_Processor Class for details if (AddressWidth == 32) return ProcessorType.x86; if (AddressWidth == 64 && Architecture == 9) return ProcessorType.x64; if (AddressWidth == 64 && Architecture == 6) return ProcessorType.IPF; } } throw new NotSupportedException(); }
  • 相关阅读:
    文章索引
    Rancher pipeline 实现简单跟踪
    rancher 应用商店
    nginx ingress 在aks 上安装
    go countdown
    go channel pipeline 套路
    gorm使用
    华为云cce pvc 指定云硬盘云存储
    influxdb 基本概念
    Python3处理xlsx去掉含有特定字符的行
  • 原文地址:https://www.cnblogs.com/profession/p/5062559.html
Copyright © 2011-2022 走看看