G
Guest
I am getting the above error with this Class Library code:
namespace ClassLibrary1
{
public class Class1
{
private string FoundPathKey;
public string LastError
{
get { return FoundPathKey; }
}
public static string Read(string path, string key)
{
string keyval = "";
try
{
FoundPathKey = "";
keyval = Microsoft.Win32.Registry.GetValue(path, key,
"Missing").ToString();
if (keyval == "Missing")
{
throw new Exception("Either the path <" + path + "> OR
the key <" + key + "> does not exist");
}
}
catch (Exception MyExcep)
{
FoundPathKey = MyExcep.Message.ToString();
}
return keyval;
}
}
}
on the two lines where I assign a value to FoundPathKey and I do not have a
clue why.
Could somene please point out what it is that I am missing?
Thank you.
namespace ClassLibrary1
{
public class Class1
{
private string FoundPathKey;
public string LastError
{
get { return FoundPathKey; }
}
public static string Read(string path, string key)
{
string keyval = "";
try
{
FoundPathKey = "";
keyval = Microsoft.Win32.Registry.GetValue(path, key,
"Missing").ToString();
if (keyval == "Missing")
{
throw new Exception("Either the path <" + path + "> OR
the key <" + key + "> does not exist");
}
}
catch (Exception MyExcep)
{
FoundPathKey = MyExcep.Message.ToString();
}
return keyval;
}
}
}
on the two lines where I assign a value to FoundPathKey and I do not have a
clue why.
Could somene please point out what it is that I am missing?
Thank you.