永发信息网

visual studio制作位图

答案:2  悬赏:0  手机版
解决时间 2021-03-18 08:10
  • 提问者网友:寂寞梧桐
  • 2021-03-17 16:56
visual studio制作位图
最佳答案
  • 五星知识达人网友:迟山
  • 2021-03-17 17:13
www.gougou.com去找个教程吧
全部回答
  • 1楼网友:不甚了了
  • 2021-03-17 17:25

学学使用安装类。

下面是个c#做的安装类示例,安装完成后对c#做的dll进行注册注册,process来调用一个程序,这里使用的是控制台,在控制台调用使用regasm来完成对dll的注册。

using system; using system.collections.generic; using system.componentmodel; using system.configuration.install; using system.diagnostics;

namespace install { [runinstaller(true)] public partial class installer1 : installer { public installer1() { initializecomponent(); this.afterinstall += new installeventhandler(installer1_afterinstall);

} public void installer1_afterinstall(object sender, installeventargs e) { string path = this.context.parameters["targetdir"]; //关闭进程 system.diagnostics.process[] process = system.diagnostics.process.getprocessesbyname("w3wp"); foreach (system.diagnostics.process p in process) { system.console.writeline(p.tostring()); p.kill(); } string filename = system.environment.getenvironmentvariable("windir") + @"\microsoft.net\framework\v2.0.50727\regasm"; string appname = path + "dbconn.dll"; process proc = new process();

proc.startinfo.filename = filename; proc.startinfo.arguments = " " + appname + " /codebase"; proc.startinfo.useshellexecute = false; proc.startinfo.createnowindow = true; proc.startinfo.redirectstandardoutput = true; proc.start(); string output = proc.standardoutput.readtoend(); proc.waitforexit();

system.console.writeline(output); system.console.readline(); }

} }

我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯