问题如上,还有如果实现了上述功能,我希望系统自动启动时加载本程序时窗口最小化,而平常双击打开时以平常窗口打开,如何实现!谢谢各位高手指导方向.
解决方案 »
- c#关于internal跟public的权限问题!
- 救命:icsharpcode.texteditor 怎么实现第几行到第几行不可编辑啊!?
- 由LinearGradientBrush逐变引起的问题
- VS2005下 水晶报表怎么按条件判断某些行显示还是不显示?? 在线等。。。 急
- C#中怎么给一个控件写自定义事件,比如当TextBox的Tag属性更改时触发。除了用Timer控件
- 求助-获取鼠标右键事件
- 关于vs2005里面智能客户端部署问题
- 写功能日志---数据库的锁定
- 提供繁体系统
- 全程送分,绝对挑战!NET2003的水晶报表只有在WIN2000运行,WIN98怎么报错?
- 请问哪里能下载最新的vs.net中文版呀,在线等!!
- 在线等待!!datagrid问题!谢谢!!!
RegistryKey regWrite= Registry.LocalMachine.CreateSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\YourKey);regWrite.SetValue("Your.exe");
load时最小化this.WindowState = FormWindowState.Minimized;
RegistryKey regWrite= Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run");regWrite.SetValue("YourKey","Your.exe");
而第二个问题,你使用NotifyIcon组件,使用其在任务栏即行。
regWrite.SetValue("aa","aa.exe");我添加成功了,但删除时却出错,提示键不存在,代码如下:
Registry.LocalMachine.DeleteSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\aa");
Registry.LocalMachine.GetValue("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\aa") 值总是为null
Registry.LocalMachine.DeleteSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\aa");如何判断是否已经有了该键?
Registry.LocalMachine.GetValue("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\aa") 值总是为null
regWrite.SetValue("aa","aa.exe");
if(Registry.LocalMachine.GetValue("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run\\aa")==null)
{
该值不存在
}
else
{
regWrite.DeleteValue("aa",true);
}