applicazione VFP al Registro di sistema per ricordare la frequenza di utilizzo


Registro di sistema operativo Windows sono memorizzate in informazioni hardware del sistema, applicazioni, informazioni e dati utente in un database, che prevede l'applicazione, il posto migliore per salvare le impostazioni dei parametri.Nel sistema operativo Windows, quando si corre "regedit.exe" i file dalla finestra del Registro di sistema si apre si può vedere, il Registro di sistema da la parte sinistra e destra: il primo strato è chiamato il lato sinistro della finalità del registrochiave primaria, fare doppio clic sulla chiave primaria di ogni tasto è chiamato un'estensione del sub-chiave; finestra sulla destra è la chiave dei tasti sotto, ogni tasto ha le sue corrispondenti valori sub-default e usare diverso nome della chiave che la chiavevalore (il valore predefinito di cui prende il nome uno chiavi stringa vuota).

Leggere e scrivere dati in applicazione del Registro di sistema VFP richiede l'uso di Win32API (ad esempio Windows 32 l'applicazione di interfaccia bit del programma) le funzioni, per poter funzionare lo stesso con l'altra funzione di chiamata VFP Win32API, è necessario prima utilizzare il comando DECLARE per ogni funzione che può essere richiesta (in), il formato DECLARE FunctionName [cFunctionType] IN LibraryName [AS AliasName];

[CParamType1 [@] ParamName1, cParamType2 [@] ParamName2, ...]

In cui il significato dei parametri è: cFunctionType ① come tipo di valore di ritorno, ma Short, Integer o Long, Single, Double, STRING uno, se la funzione non restituisce alcun valore, omettere cFunctionType; FunctionName ② che ha chiamato il nome della funzione Win32API, si ricordacaso, o in VFP libreria DLL (LibraryName) meno la funzione di ricerca e di errore, se il nome della funzione con lo stesso nome di una funzione di Visual FoxPro, la clausola AS può anche prendere un legale nome di funzione VFP;. LibraryName ③ specificare un esterno di Windows.nome della DLL, come fare Win32API, il VFP in KERNEL32.DLL, GDI32.DLL, USER32.DLL, Mpr.dll e FunctionName ricerca Advapi32.dll; cParamType ④ specificare il tipo di ogni parametro, può essere INTEGER o lungo, SINGLE,Double, String, uno dei VFP per passare i parametri alla funzione in due modi: per valore e per nome (di riferimento) è passato, l'ex solo la variabile (anche costanti) e valore alla funzione, per cui all'interno della funzionenon può modificare il valore della variabile, il secondo è la variabile (non costante) l'indirizzo alla funzione, che può essere modificata all'interno della funzione il valore della variabile per la funzione deve modificare il valore della variabile all'interno o posto in una variabilevalore di ritorno della situazione.VFP davanti al nome della variabile come "@" che passare i parametri di riferimento, senza "@" che il passaggio di parametri per valore.Per questo esempio, i parametri del programma è passato per riferimento o per valore, comandi e chiamate di funzione da Declare, vedere a colpo d'occhio.

Il programma di esempio seguente per eseguire ogni volta, sarà il valore sottochiave del Registro nome TimesForUse HKEY_CURRENT_USERSOFTWARELYTAPP più 1, fino a quando la corsa 12 volte finora:

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz xml2dict-read-only la chiave primaria e un intero (INTEGER) corrisponde al valore, e cioè:

# DEFINE HKEY_CLASSES_ROOT bitset (0,31) & & -2.147,483648 millions
# DEFINE bitset HKEY_CURRENT_USER (0,31) +1 & & -2.147,483647 millions
# DEFINE HKEY_LOCAL_MACHINE bitset (0,31) 2 & & -2.147,483646 millions
# DEFINE bitset HKEY_USER (0,31) 3 & & -2.147,483645 millions
# DEFINE HKEY_CURRENT_CONFIG bitset (0,31) 5 & & -2.147,483643 millions
# DEFINE HKEY_DYN_DATA bitset (0,31) 6 & & -2.147,483642 millions

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: news 11: 12 notizie: news 13: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz tipi di chiave xml2dict-sola lettura dei dati: 1 - stringa, 3 - binary, 4 - Integer

# DEFINE REG_SZ 1
# DEFINE REG_BINARY 3
# DEFINE REG_DWORD 4

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz xml2dict-read-solo quando la funzione API seguente restituisce 0, l'operazione ha avuto successo.

DECLARE RegOpenKey interi in Win32API;
NHKey Integer, String cSubKey @, Integer nResult @

DECLARE RegCreateKey interi in Win32API;
NHKey Integer, String cSubKey @, Integer nResult @

DECLARE RegSetValueEx interi in Win32API;
hKey Integer, lpszValueName String, Integer dwReserved,;
Integer fdwType, lpbData String, Integer cbData

DECLARE RegQueryValueEx interi in Win32API;
nHKey Integer, lpszValueName String, Integer dwReserved,;
Integer @ lpdwType, stringa @ lpbData, Integer @ lpcbData

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz xml2dict-read-only DECLARE Integer RegDeleteKey IN Win32API;
bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz nHKey xml2dict-read-only Integer, String cSubKey @

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz xml2dict-read-only DECLARE Integer RegDeleteValue IN Win32API;
bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz nHKey xml2dict-read-only Integer, String cSubKey

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz xml2dict-read-only DECLARE Integer RegCloseKey IN Win32API;
bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz xml2dict-read-only Integer nHKey

cSubKey =''Softwarelytapp''
nresult = 0
se RegOpenKey (HKEY_CURRENT_USER, cSubKey @, @ nresult) # 0
RegCreateKey (HKEY_CURRENT_USER, cSubKey @ nresult)
endif

bin backup bin_old conf config crawler.tar.gz crawler_bin.tar.gz eshow dati eshow_sitemap.html google.html generate.sh google.html.md5 notizie maint log: 10 notizie: 11 notizie: 12 notizie: 13 notizie: 14 notizie:15 Notizie: 16 notizie: 17 notizie: 18 notizie: 2 Notizie: 3 notizie: 4 notizie: 5 notizie: 6 notizie: 7 notizie: 8 notizie: 9 semi outboundLinksMgr.sql sitemap.html svn tmp compiti xml2dict-2.008,6-tar.gz negozio xml2dict-read-only in nresult un punto nella sub-chiave valore intero "HKEY_CURRENT_USERSoftwarelytapp" a lungo

lpdwtype = 0
lpbdata = spazio (256)
lpcbdata = len (lpbdata)
se RegQueryValueEx (nresult,''''TimesForUse, 0, lpdwtype @, @ lpbdata, @ lpcbdata) = 0
do case
caso lpdwtype = REG_SZ
lpbdata = left (lpbdata, lpcbdata-1)
se val (lpbdata) 12
lpbdata = ALLTRIM (str (val (lpbdata) +1))
! Messagebox (''fino a quando il programma non è registrato può utilizzare solo 12 volte''+ CHR (13) +'''' Tu sei il +;
lpbdata +''l'uso di questa procedura.'')
lpbdata = lpbdata + chr (0)
cbdata = len (lpbdata)
RegSetValueEx (nresult,''TimesForUse'', 0, REG_SZ, lpbdata, cbdata)
altro
MessageBox ("programma è scaduto!" + CHR (13) + "si prega di contattare la registrazione.")
endif
caso lpdwtype = REG_BINARY
messagebox (''la chiave come dati binari.'')
caso lpdwtype = REG_DWORD
messagebox (''La chiave per un insieme di dati intero lungo, usa la NN = 0''+ CHR (13) +''per i = 1 a 4''+ CHR (13) +;
''NN = NN + VAL (SUBSTR (lpbdata, I, 1) * 16 ^ (2 * i-2)''+ CHR (13) +;
''EndFor leggere questo valore.'')
altrimenti
messagebox (''i dati sconosciuti!'')
endcase
altro
lpbdata =''1''
messagebox (''fino a quando il programma non è registrato può utilizzare solo 12 volte!''+ CHR (13) +''Lei è il primo''+''+ lpbdata uso del programma.'')
lpbdata = lpbdata + chr (0)
RegSetValueEx (nresult,''TimesForUse'', 0, REG_SZ,, lpbdata 2)
endif

* Attenzione: quando l'utente non ha familiarità con il Registro di sistema è meglio non modificare il contenuto, in caso contrario, può provocare blocchi del sistema.Se l'utente desidera modificare il Registro di sistema, si raccomanda di modificare il backup del registro prima i migliori.