🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: free.it.visual-basic
Article #3563

Re: Accedere ai registri....come?

#3563
From: Frankie
Date: Thu, 13 Jun 2002 21:00
40 lines
2524 bytes
Dunque, ci sono almeno un paio di metodi:

    1. Usare le API di Windows (troppo scocciante, troppi nomi da ricordare)
    2. Usare gli oggetti (metodo sbrigativo)

Parler� del secondo. Dunque, per effettuare una connessione con il registro
di Windows, basta creare un oggetto registro in questo modo:

Dim Registry As Object
Set Registry = CreateObject("Wscript.Shell")
Registry.Read("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat
Reader\5.0\InstallPath")

Questo � un metodo molto pi� sbrigativo che evita la chiamata alle API in
quanto la dichiarazione CreateObject mette in funzione la stessa API. A
questo punto � facile capire che si pu� assegnare la connessione ad una
variabile per effettuare il controllo di un valore. Es:

Dim Registry As Object
Set Registry = CreateObject("Wscript.Shell")
If Registry.Read("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat
Reader\5.0\InstallPath") <> "C:\Programmi\Adobe") Then
    'Immettere il codice desiderato
End If

Frankie

"jekonet" <fitofito@tiscalinet.it> ha scritto nel messaggio
news:Ri4O8.10164$j65.222652@twister1.libero.it...
> ciao ragazzi,
> la domanda � semplice:
> come faccio se voglio leggere il valore di una chiave del tipo
> HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\5.0\InstallPath
> ?
>
> ho provato co GetSetting ma lavora solo nel registro di VB...dove sbaglio?
>
> Grazzzzz
>
>
Technical Details
Message-ID: <tJ7O8.11216$Kt3.248828@twister2.libero.it>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!supernews.com!feed.textport.net!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail
References: <Ri4O8.10164$j65.222652@twister1.libero.it>

Show Full Headers
Complete Article Headers
X-Google-Language: ITALIAN,ASCII
X-Google-Thread: f94ee,ad4efc12927b7ad6
X-Google-Attributes: gidf94ee,public
X-Google-ArrivalTime: 2002-06-13 14:00:17 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-05!supernews.com!feed.textport.net!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.infostrada.it!twister2.libero.it.POSTED!not-for-mail
From: "Frankie" <frankiepaul@libero.it>
Newsgroups: free.it.visual-basic
References: <Ri4O8.10164$j65.222652@twister1.libero.it>
Subject: Re: Accedere ai registri....come?
Lines: 42
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Message-ID: <tJ7O8.11216$Kt3.248828@twister2.libero.it>
Date: Thu, 13 Jun 2002 21:00:09 GMT
NNTP-Posting-Host: 151.26.10.85
X-Complaints-To: abuse@libero.it
X-Trace: twister2.libero.it 1024002009 151.26.10.85 (Thu, 13 Jun 2002 23:00:09 MET DST)
NNTP-Posting-Date: Thu, 13 Jun 2002 23:00:09 MET DST
Organization: [Infostrada]