标签:false test window use shell mys inf pre sage
两种方式
1.Cmd手动注册dll
regsvr32 D:\Project\大漠\DMTest\dm.dll
2.程序注册dll
static string AutoRegCom() { string strCmd = @"regsvr32 D:\Project\大漠\DMTest\dm.dll"; string rInfo; try { Process myProcess = new Process(); ProcessStartInfo myProcessStartInfo = new ProcessStartInfo("cmd.exe"); myProcessStartInfo.UseShellExecute = false; myProcessStartInfo.CreateNoWindow = true; myProcessStartInfo.RedirectStandardOutput = true; myProcess.StartInfo = myProcessStartInfo; myProcessStartInfo.Arguments = "/c " + strCmd; myProcess.Start(); StreamReader myStreamReader = myProcess.StandardOutput; rInfo = myStreamReader.ReadToEnd(); myProcess.Close(); rInfo = strCmd + "\r\n" + rInfo; return rInfo; } catch (Exception ex) { return ex.Message; } }
引用:using Dm;
声明大漠插件:
dmsoft dm = new dmsoft();
标签:false test window use shell mys inf pre sage
原文地址:https://www.cnblogs.com/tangpeng97/p/12696074.html