Ejemplo n.º 1
0
 public string GetPasswordForLogin(ProviderConfigurationItem providerConfigurationItem, string userName)
 {
     RegistryKey companyKey = Registry.CurrentUser.OpenOrCreateCompanyKey();
     RegistryKey geoPatKey = companyKey.OpenOrCreateKey("GeoPat");
     RegistryKey configKey = geoPatKey.OpenOrCreateKey("Configuration");
     RegistryKey providersKey = configKey.OpenOrCreateKey("Providers");
     String providerKeyName = providerConfigurationItem.GetHash();
     RegistryKey keyProvider = providersKey.OpenOrCreateKey(providerKeyName);
     if (keyProvider.GetValueNames().Contains(userName))
     {return keyProvider.GetValue(userName).ToString();}
     return "";
 }
Ejemplo n.º 2
0
 public void SetLoginPassword(ProviderConfigurationItem providerConfigurationItem, string login, string passord)
 {
     RegistryKey companyKey = Registry.CurrentUser.OpenOrCreateCompanyKey();
     RegistryKey geoPatKey = companyKey.OpenOrCreateKey("GeoPat");
     RegistryKey configKey = geoPatKey.OpenOrCreateKey("Configuration");
     RegistryKey providersKey = configKey.OpenOrCreateKey("Providers");
     String providerKeyName = providerConfigurationItem.GetHash();
     RegistryKey keyProvider = providersKey.OpenOrCreateKey(providerKeyName);
     keyProvider.SetValue(login, passord);
 }