How to read from windows register???

pavel.konirpavel.konir Member Posts: 7
Hallo,
how to read from windows register in Navision???
I have Idee use any dll...

Comments

  • WaldoWaldo Member Posts: 3,412
    Well, I'm no export, but in the .NET framework, there are some namespaces/stuff that you can use like:
    Dim regKey As RegistryKey
    regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True)
    regKey.CreateSubKey("MyApp")
    regKey.Close()
    
    and
    Dim regKey As RegistryKey
    Dim ver As Decimal
    regKey = Registry.LocalMachine.OpenSubKey("Software\MyApp", True)
    regKey.SetValue("AppName", "MyRegApp")
    ver = regKey.GetValue("Version", 0.0)
    If ver <  1.1 Then
    regKey.SetValue("Version", 1.1)
    End If
    regKey.Close()
    

    What I would do is create an automation (dll) in .NET with the functions I need to update the registry, and use it in my C/SIDE application.

    Off course, if there is allready some kind of automation/OCX or whatever that I don't know of, then use that one ... .

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • kinekine Member Posts: 12,562
    Check the Automation "'Windows Script Host Object Model'.WshShell or "'Windows Script Host Object Model'.IWshShell_Class" (it depend on your OS version). There is RegRead, RegWrite etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • WaldoWaldo Member Posts: 3,412
    Like I allready expected ... that's indeed the automation I didn't know of ...

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.