读注册表

public static string GetPath()
{
string sPath;
RegistryKey lRk_Path;
lRk_Path = Registry.CurrentUser;

//打开software目录
RegistryKey software = lRk_Path.OpenSubKey("Software");
RegistryKey odbc = software.OpenSubKey("ODBC");
RegistryKey odbcini = odbc.OpenSubKey("ODBC.INI");
RegistryKey Xsc = odbcini.OpenSubKey("Xsc");
sPath = Xsc.GetValue ("Path").ToString ();
return sPath;

}

你可能感兴趣的:(注册表)