2014年1月12日 星期日

RegisterKey

public string ReadRegisterKey()
{
            string sPW = "";
            RegistryKey Reg = Registry.CurrentUser.OpenSubKey("Software", true);
            string[] ssNames = Reg.GetSubKeyNames();
            sPW = System.Convert.ToString(Registry.GetValue("HKEY_CURRENT_USER\\Software\\foxlink", "admin", ""));
            if (sPW == "") sPW = "admin";
            return sPW.Trim();

}


 public bool WriteRegisterKey(string sPW)
        {
            RegistryKey Reg = Registry.CurrentUser.OpenSubKey("Software", true);
            Registry.SetValue("HKEY_CURRENT_USER\\Software\\foxlink", "admin", sPW, RegistryValueKind.String);
            return true;
        }

沒有留言:

[c#] process 使用方法

寫法1. Process proc = new Process(); / /PowerShell.exe path proc.StartInfo.FileName = @"c:\Windows\System32\ WindowsPowerShell\v1.0\ powe...