DevAdmin Blog

Blog di Ermanno Goletto (Microsoft MVP Directory Services - MCITP - MCTS - MCSA - MCP)
posts - 886, comments - 447, trackbacks - 13

My Links

News

Avatar

Curriculum Vitae

Visualizza il profilo di Ermanno Goletto su LinkedIn


Il contenuto di questo blog e di ciascun post viene fornito “così come é”, senza garanzie, e non conferisce alcun diritto. Questo blog riporta il mio personale pensiero che non riflette necessariamente il pensiero del mio datore di lavoro.

Logo Creative Commons Deed


Logo SysAdmin.it SysAdmin.it Staff


Logo TechNet Forum TechNet Italia @ForumTechNetIt Follow TechNet Forum on Twitter


Logo MVP


Ermanno Goletto Follow ermannog on Twitter

Article Categories

Archives

Post Categories

Blogs

Friends

Knowledge Base

MVP Sites

Resources

Ottenere Versione e Path del client di Navision installato

Queste informazioni sono reperibili tramite la seguente chiave di registro:
HKEY_LOCAL_MACHINE\SOFTWARE\Navision\Microsoft Business Solutions-Navision

Questa chiave ha una sottochiave che rappresenta la versione installata (xes W1 4.00) che a sua volta contiene un valore Path che rapprasenta il percorso in cui è stato installato il client di Navision

Di seguito il codice per ottenere le informazioni in VB.Net:

    Public Shared Function GetNavisionVersion() As String
        Dim value As String = String.Empty

        Try
            Dim key As Microsoft.Win32.RegistryKey
            key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey( _
                          "SOFTWARE\Navision\Microsoft Business Solutions-Navision", False)

            value = key.GetSubKeyNames()(0)
        Catch ex As Exception
            Throw New System.ApplicationException("Navision Client is not installed.", ex)
        End Try

        Return value
    End Function

    Public Shared Function GetNavisionClientPath() As String
        Dim value As String = String.Empty

        Try
            Dim key As Microsoft.Win32.RegistryKey
            key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey( _
                          "SOFTWARE\Navision\Microsoft Business Solutions-Navision\" & _
                GetNavisionVersion(), False)

            value = key.GetValue("Path").ToString()
        Catch ex As Exception
            Throw New System.ApplicationException("Navision Client is not installed.", ex)
        End Try

        Return value
    End Function

Print | posted on Wednesday, February 08, 2006 1:51 PM | Filed Under [ Code, Snippets & Scripts Navision ]

Feedback

No comments posted yet.

Post Comment

Title  
Name  
Email
Url
Comment   
Please add 1 and 8 and type the answer here:

Powered by:
Powered By Subtext Powered By ASP.NET