summaryrefslogtreecommitdiff
path: root/csharp/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2018-09-04 18:20:16 +0200
committerJose <jose@zeroc.com>2018-09-04 18:28:45 +0200
commit17c4cd26954259b12c2fa2d03bcc5738875735f2 (patch)
tree22f2acd1ad3f3eb091ca01153b7001843778b6c0 /csharp/src
parentMATLAB UnsupportedProtocolException missing "reason" member (diff)
downloadice-17c4cd26954259b12c2fa2d03bcc5738875735f2.tar.bz2
ice-17c4cd26954259b12c2fa2d03bcc5738875735f2.tar.xz
ice-17c4cd26954259b12c2fa2d03bcc5738875735f2.zip
Add support for read properties from HKCU windows registry
It was possible before to read Ice properties from HKLM Windows this fix alows to also read properties from HKCU Close #130
Diffstat (limited to 'csharp/src')
-rw-r--r--csharp/src/Ice/PropertiesI.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/csharp/src/Ice/PropertiesI.cs b/csharp/src/Ice/PropertiesI.cs
index 7b647cb0c20..f1e806c2b07 100644
--- a/csharp/src/Ice/PropertiesI.cs
+++ b/csharp/src/Ice/PropertiesI.cs
@@ -313,9 +313,12 @@ namespace Ice
public void load(string file)
{
#if NET45
- if(file.StartsWith("HKLM\\", StringComparison.Ordinal))
+ if(file.StartsWith("HKCU\\", StringComparison.Ordinal) ||
+ file.StartsWith("HKLM\\", StringComparison.Ordinal))
{
- RegistryKey iceKey = Registry.LocalMachine.OpenSubKey(file.Substring(5));
+ RegistryKey key =
+ file.StartsWith("HKCU\\", StringComparison.Ordinal) ? Registry.CurrentUser : Registry.LocalMachine;
+ RegistryKey iceKey = key.OpenSubKey(file.Substring(file.IndexOf("\\") + 1));
if(iceKey == null)
{
Ice.InitializationException ex = new Ice.InitializationException();