none
Entering the Registry Key RRS feed

  • Question

  • Hi..

      I am creating a Registry for my application (C# windows application) and reading and updating my registry key.

    It is working fine in Windows Xp.But when i am installing my application in Windows Server 2008 ,The registry keys are not stored in the specified location and updation and reading created problem.
    What might be the problem??

    Can any body help me??

    My code for updating and reading from the registry is

    RegistryKey

     

    Regkey = Registry.LocalMachine.OpenSubKey("Software\\ReportWriter");



    Reading from the registry


    txtDataSource.Text = Decrypt((

    string)Regkey.GetValue("DataSource"));

    txtUser.Text = Decrypt((

    string)Regkey.GetValue("UID"));

    txtPwd.Text = Decrypt((

    string)Regkey.GetValue("PWD"));

    txtIPAddress.Text = Decrypt((

    string)Regkey.GetValue("IpAddress"));

    txtFactoryType.Text = Decrypt((

    string)Regkey.GetValue("FactoryType"));



     

    Updating the Registry


    Regkey = Registry.LocalMachine.CreateSubKey("Software\\ReportWriter");

    Regkey.SetValue(

    "DataSource", (string)Encrypt(txtDataSource.Text));

    Regkey.SetValue(

    "UID", (string)Encrypt(txtUser.Text));

    Regkey.SetValue(

    "PWD", (string)Encrypt(txtPwd.Text));

    Regkey.SetValue(

    "IpAddress", (string)Encrypt(txtIPAddress.Text));

    Regkey.SetValue(

    "FactoryType", (string)Encrypt(txtFactoryType.Text));

     

    Thank you,

    DummyBullet.
      

     


    Best Regards, Dummy Bullet.
    Monday, May 25, 2009 2:19 PM

All replies

  • Hi,

     

    I am not sure about this behaviour.

    You are logged in as which account? Is UNC active?

    I am not sure, I suspect that this might be due to file/registry  virtualization. 

     

    Hope this helps.

     

    Thanks

    Asha

    • Proposed as answer by Asha M Wednesday, May 27, 2009 2:41 PM
    Wednesday, May 27, 2009 2:41 PM
  • Yes .The problem is due to file/registry Virtualization only.

    The Key entries are written in some Virtual stores.

    Is there any solution for this?? I have to set any permissions??

    Thank you verymuch.
    Best Regards, Dummy Bullet.
    Thursday, May 28, 2009 5:22 AM
  • Hi,

    Writing in to registry location is strictly not allowed in vista and server 2008.
    Please makes sure you have proper manifest in your application to write into registry location.

    you may have to look into the below link:

    http://code.msdn.microsoft.com/Windows7AppQuality/Release/ProjectReleases.aspx?ReleaseId=1734


    Hope above helps.

    Thanks
    Asha
    • Proposed as answer by Asha M Tuesday, July 7, 2009 2:32 PM
    Tuesday, July 7, 2009 2:32 PM