using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Runtime.InteropServices; namespace CommonLib { /// /// 原delphi公用类 /// public abstract class Publentry { //**************************************************************** // PC信息归类 //**************************************************************** /// /// 计算机名称 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetPcName")] public static extern string XGetPcName(); /// /// 计算机ip /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetPcIp")] public static extern string XGetPcIp(); /// /// 通过IP取计算机名称 /// /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetPcNameByIp")] public static extern string XGetPcNameByIp(StringBuilder ip); /// /// 通过名称得IP取名称 /// /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetPcIpByName")] public static extern string XGetPcIpByName(StringBuilder Name); /// /// 取网卡MAC /// /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetMacAddress")] public static extern string XGetMacAddress(int Index); /// /// 取得到CpuID号 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetCPUID")] public static extern Int64 XGetCPUID(); //**************************************************************** // 操作系统归类 //**************************************************************** /// /// 得到操作系统 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetOs")] public static extern string XGetOs(); /// /// 登录名 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetOsLogin")] public static extern string XGetOsLogin(); /// /// 版本号 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetOsVersion")] public static extern string XGetOsVersion(); /// /// 启动模试 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetOsBootMode")] public static extern string XGetOsBootMode(); /// /// 取系统目录{测试通过} /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetOsSysDir")] public static extern string XGetOsSysDir(); /// /// 取临时目录 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetOSTempDir")] public static extern string XGetOSTempDir(); /// /// 修正目录‘/’ /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XSuffixDir")] public static extern string XSuffixDir(StringBuilder dir); /// /// 当前目录 /// /// [DllImport("Xlpublic.DLL", EntryPoint = "XGetCurrentDir")] public static extern string XGetCurrentDir(); [DllImport("Xlpublic.DLL",CharSet = CharSet.Ansi,CallingConvention=CallingConvention.StdCall)] public static extern string XGetDate(StringBuilder Userid); [DllImport("ls_TOOLS/PublicLibrary.dll",CharSet = CharSet.Ansi,CallingConvention=CallingConvention.StdCall)] public static extern string Decrypt_Des(StringBuilder pValue, byte[] arrKey); } }