【发布时间】:2013-10-10 10:34:16
【问题描述】:
我已经完成了 Windows 窗体应用程序的维护工作,该应用程序包含窗体的 Form_Load 方法上的 windows RegistryKey 代码。但我不知道 RegistryKey 代码 sn-p 正在执行什么工作。这是我的让我困惑的代码..
try
{
RegistryKey rkStartUp = Registry.LocalMachine;
RegistryKey StartupPath;
StartupPath = rkStartUp.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (StartupPath.GetValue("ABCDXYZ") == null)
{
StartupPath.SetValue("ABCDXYZ", Application.ExecutablePath, RegistryValueKind.ExpandString);
}
}
catch
{
}
任何解释它的帮助将不胜感激。
【问题讨论】:
标签: c# registry windows-api-code-pack