注册Jmail组件的三种方法
2008-11-28 18:27
375 查看
1、在命令行下执行:
cmd
regsvr32 jmail.dll
2、在安装程序中:
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
try
{
/*
在制作安装包时,自定义操作->安装,添加自定义操作(来自XX安装程序的主输出),配置
CustomerActionData=/targetdir="[TARGETDIR]/"
*/
string targetdir=this.Context.Parameters["targetdir"].Trim();
if(!targetdir.EndsWith(@"/"))
targetdir+=@"/";
//注册Jmail组件
try
{
JmailReg(targetdir);
}
catch(Exception)
{ }
}
catch(Exception ex)
{
throw ex;
}
}
3、在Windows应用程序中:
private void DoUpdate()
{
string strPath=Application.StartupPath;
IniFile ini = new IniFile(strPath+@"/sys.ini");
//注册Jmail
if(ini.IniReadValue("System","JmailReg").ToString()!="1")
{
JmailReg(strPath);
ini.IniWriteValue("System","JmailReg","1");
}
}
private void JmailReg(string targetdir)
{
try
{
ProcessStartInfo processInfo =new ProcessStartInfo("regsvr32");
//processInfo.WindowStyle=ProcessWindowStyle.Normal;
processInfo.WindowStyle=ProcessWindowStyle.Hidden;
processInfo.Arguments=" /s "+ Char.ToString('"') + targetdir + "jmail.dll"+Char.ToString('"');
Process osql = Process.Start(processInfo);
//Wait till it is done...
osql.WaitForExit();
osql.Dispose();
processInfo=null;
}
catch(Exception)
{}
}
cmd
regsvr32 jmail.dll
2、在安装程序中:
public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
try
{
/*
在制作安装包时,自定义操作->安装,添加自定义操作(来自XX安装程序的主输出),配置
CustomerActionData=/targetdir="[TARGETDIR]/"
*/
string targetdir=this.Context.Parameters["targetdir"].Trim();
if(!targetdir.EndsWith(@"/"))
targetdir+=@"/";
//注册Jmail组件
try
{
JmailReg(targetdir);
}
catch(Exception)
{ }
}
catch(Exception ex)
{
throw ex;
}
}
3、在Windows应用程序中:
private void DoUpdate()
{
string strPath=Application.StartupPath;
IniFile ini = new IniFile(strPath+@"/sys.ini");
//注册Jmail
if(ini.IniReadValue("System","JmailReg").ToString()!="1")
{
JmailReg(strPath);
ini.IniWriteValue("System","JmailReg","1");
}
}
private void JmailReg(string targetdir)
{
try
{
ProcessStartInfo processInfo =new ProcessStartInfo("regsvr32");
//processInfo.WindowStyle=ProcessWindowStyle.Normal;
processInfo.WindowStyle=ProcessWindowStyle.Hidden;
processInfo.Arguments=" /s "+ Char.ToString('"') + targetdir + "jmail.dll"+Char.ToString('"');
Process osql = Process.Start(processInfo);
//Wait till it is done...
osql.WaitForExit();
osql.Dispose();
processInfo=null;
}
catch(Exception)
{}
}
相关文章推荐
- 注册Jmail组件的三种方法
- 注册Jmail组件的三种方法
- asp.net向客户端注册JavaScript脚本的三种方法
- COM+组件注册方法 作者:郑金冶
- 第一节、什么是Vue组件及组件的注册方法
- Autofac官方文档(五)【注册组件之属性和方法注入】
- ASP封装DLL服务器上不需注册组件的方法
- Regsvr32(windows注册/卸载组件)的使用方法详细说明
- android View的绘制过程和获取组件高宽值的三种方法
- C# 注册组件方法
- 在VC中使用代码组件的三种方法
- 在VC中使用代码组件的三种方法
- 比较Java Swing中三种注册事件的方法
- jmail组件 对象不支持此属性或方法: 'JMail.ServerAddress' 的解决办法
- ATL3.0组件注册bug的解决方法
- Jmail组件常用类属性和方法介绍
- Java 注册监听器的方法总结(自身类this+外部类+内部类+匿名内部类+适配器Adapter+一个组件注册多个监听器)
- 三种禁用虚拟机FSO组件的方法
- 三种禁用FileSystemObject组件的方法
- 解决 window server2008 r2 没有注册Ofiice组件的方法