import dotNet; import System; //.NET 命名空间。 dotNet.import("System.Security.Cryptography","mscorlib"); //子命名空间不在同一程序集,用哪个导入哪个,不会覆盖已存在的父命名空间 dotNet.import("System.Security.Cryptography.X509Certificates","System"); //子命名空间不在同一程序集,用哪个导入哪个,不会覆盖已存在的父命名空间 dotNet.import("System.Security.Cryptography.X509Certificates.X509Certificate","mscorlib"); dotNet.import("System.Security.Cryptography.X509Certificates.X509ContentType","mscorlib"); dotNet.import("System.Security.Cryptography.X509Certificates.X509KeyStorageFlags","mscorlib"); try{ dotNet.import("System.Security.Cryptography.X509Certificates.CertificateRequest","System.Core"); dotNet.import("System.Security.Cryptography.X509Certificates.CertificateRequestLoadOptions","System.Core"); } /* 在不同的程序集导入相同名字路径的 .NET 命名空间, 则后面导入的命名空间不能覆盖替换先前导入的 .NET 命名空间。 也无法自动合并,只能通过 dotNet.import 函数的返回值获取导入的新命名空间。 所以为了减少 dotNet.import 调用次数。 要检查某个命名空间的主要成员是在哪个程序集里。 请参考:范例 » 调用其他语言 » dotNet » 进阶 » 命名空间分析 */ /*****intellisense() System.Security.Cryptography = .NET 命名空间 System.Security.Cryptography 导入库。\n导入了:\nSystem.Security.Cryptography\n \nSystem.Security.Cryptography.X509Certificates\nSystem.Security.Cryptography.X509Certificates.CertificateRequest System.Security.Cryptography.? = .NET 命名空间、类、结构体的成员,\n可访问成员命名空间、类、枚举、静态属性或字段,\n导入的类可用于构造 .NET 对象,传回 .NET 则自动转为该类的 Type 对象\n!dotNetNameSpace. System.Security.Cryptography.__assembly__ = 导入此 .NET 命名空间的程序集对象。\n!dotNetCrlAssembly. end intellisense*****/