tunacha
11-10-2009, 10:37 PM
Well ive been trying to read a install path of this program from the registry all day and i cant seem to get it to work i keep getting unhandled exceptions''
So i was wondering if anyone could at least tell me what im doing wrong so ican tr7y to learn how to fix it, this is my first time trying o do anything with the registry in c# or any programming language so any help would be appreciated
Heres the code i have made to try to do this
ive added comments to each part aswell
//Registry read
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"\Software\Joymax\Silkroad");
string sro_path = Convert.ToString(key.GetValue("InstallPath".ToString()));
// Start silkroad
System.Diagnostics.Process sro = new System.Diagnostics.Process();
sro.StartInfo.FileName = sro_path + @"\silkroad.exe";
sro.Start();
So i was wondering if anyone could at least tell me what im doing wrong so ican tr7y to learn how to fix it, this is my first time trying o do anything with the registry in c# or any programming language so any help would be appreciated
Heres the code i have made to try to do this
ive added comments to each part aswell
//Registry read
RegistryKey key = Registry.LocalMachine.OpenSubKey(@"\Software\Joymax\Silkroad");
string sro_path = Convert.ToString(key.GetValue("InstallPath".ToString()));
// Start silkroad
System.Diagnostics.Process sro = new System.Diagnostics.Process();
sro.StartInfo.FileName = sro_path + @"\silkroad.exe";
sro.Start();