Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Registry of Remote HKLM via ASP.NET/VB.NET

Status
Not open for further replies.

MapMan

Programmer
Jul 21, 1999
143
US
Hi All,

I have this code, snippet below, to read a registry key in the HKLM class. It works. But the problem is, it reads the registry of the IIS server, not the client connecting. Does anyone know what I need to do so that I can read the remote computer's registry file?


Code:
    Private Sub ChkFramework() 
        Dim aKey As RegistryKey = Registry.LocalMachine 
        Dim oKey As RegistryKey 
        Dim oTheValue As Object 
        Dim szResult As String = "" 

        Try 
            oKey = aKey.OpenSubKey(CStr("software\\microsoft\\.netframework\\policy\\v1.0"), False) 
            oTheValue = oKey.GetValue(CStr("3705"), "") 
            If (Not oTheValue Is Nothing) Then 
                szResult = oTheValue 
            Else 
                szResult = "" 
            End If 

        Catch ex As Exception 

        Finally 
            If szResult <> &quot;3321-3705&quot; Then 
                lblFrmStat.Text = &quot;Not Installed&quot; 
                lblFrmStat.Font.Bold = True 
                hypFrm.NavigateUrl = &quot;[URL unfurl="true"]http://localhost/NetNetWeb/netfx.msi&quot;[/URL] 
                hypFrm.Text = &quot;Install/Upgrade .Net Framework&quot; 
            Else 
                lblFrmStat.Text = &quot;Installed&quot; 
                lblFrmStat.Font.Bold = False 
                hypFrm.NavigateUrl = &quot;&quot; 
                hypFrm.Text = &quot;None&quot; 
            End If 
        End Try 
    End Sub

I call this function from the Private Sub Page_Load event of the ASP page. An example follows...


Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
        Call ChkFramework() 
        Call DisplayHelp() 
    End Sub

Thanks a bunch,
MapMan [americanflag]

Assume nothing, question everything, be explicit not implicit, and you'll always be covered.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top