安装程序把序列号写到注册表,你的程序再读出来校验啊~~~~~~~~
解决方案 »
- MS chart 鼠标点在曲线上时间显示为 1899-12-30
- 各位大侠帮忙看看为什么EXCEL读不出来?
- 如何上传大文件
- 使用Assembly.LoadFrom加载了一个程序集后在修改这个文件的时候报错,请问如何解决
- 在C#中调用命令行程序(java 或 javac)后如何获得命令行程序的输出,请大哥帮忙
- 关于winform做一个视频播放器
- DataGridView无法更新到数据库 点击更新按钮会清除输入的数据····(初学者 麻烦写的详细点)
- 如何将DataGrid中的数据导入到Excel中
- [急]非常幼稚的问题
- 如何获得本机DNS地址
- TreeView如何动态装载节点?急!!!
- 高手求救,DataGrid的赋值的问题?
是不是有个安装结束时的事件可以写啊
protected string readRegistry()
{
string getValue="";
try
{
RegistryKey regRead=Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Userdata\S-1-5-21-1614895754-1677128483-1957994488-1004\Products\4E8612854008FA246980D2307BEAF89C\InstallProperties");
getValue=(string)regRead.GetValue("ProductID");
regRead.Close();
}
catch(Exception)
{
throw new InstallException("读注册表ProductID:"+getValue);
} return getValue;
}public override void Install(System.Collections.IDictionary stateSaver)
{
base.Install(stateSaver);
connstring="server=127.0.0.1;Integrated Security=SSPI;";
try
{
//Security Lock Checking
string ProductID=readRegistry();运行到此处读注册表出错
//chkdog(getValue); //database operation
sqlConnection1=new SqlConnection(connstring);
AddDBTable(this.Context.Parameters["dbname"]);
//update the config file
//ReplaceUserPwd("d:\\netxxzx\\wwwroot\\sdm_centerm\\Web.config",uid,pwd); //create virtual dir
CreateVirtualDir();
//regist com+
//registCom(); }
catch (Exception e)
{
Console.Write("操作失败:"+e.Message);
throw e;
}}