[SOLVED] Wisej app read and write registry

Answered Closed
0
0

Hi Wisej,

I am using wisej app to read and write Registry.

When running in VisualStudio. It gets value of registry, done.

When running in webhost. It gets value of registry, not done.

How to read and write Registry on webhost?

Thank you.

  • You must to post comments
Best Answer
0
0

Hi Huỳnh,

You can also access a registry specific for your Wisej application using something like this:

Application.CommonAppDataRegistry.SetValue(“Test”, “12345”)

It’s saved under (in your case) \HKEY_LOCAL_MACHINE\SOFTWARE\WisejWeb\1.0.0.0.

 

Best,

Levie

  • You must to post comments
0
0

Hi Levie (ITG) ,

I use Application.CommonAppDataRegistry.SetValue(“Testing”, “True”). It is denied

How to use “HKEY_CURRENT_USER\Software” in Wisej app?

Thank you.

  • Levie (ITG)
    Forgot to mention, you need to make sure the Application Pool’s Identity is set to a user that has permission to access HKEY_LOCAL_MACHINE. You can create a custom user with the specified permissions. Best, Levie
  • Levie (ITG)
    To answer the other part of the question about using HKEY_CURRENT_USER\Software, you won’t be able to because it’s only accessible for the logged in user (that’s why it works on IISExpress). When using an Application Pool Identity the system uses the resources of the Identity account, which is why it shows up under HKEY_USERS.
  • Huỳnh Tấn Phát
    Oki… It is done. Thank you so much, Levie (ITG).
  • You must to post comments
0
0

Hi Huỳnh,

This isn’t a Wisej issue, but the issue occurs because it’s not reading from where you think it is.

When you try reading from the Registry under that ApplicationPool it’s actually reading from a specific profile in HKEY_USERS.

Try writing to the registry first and then search under HKEY_USERS for the created registry entry.

It will be a path similar to the screenshot I attached!

Best regards,

Levie

 

Attachment
  • You must to post comments
Showing 3 results