📄 clsregistryaccess.cls
字号:
' sPath - string; path to key '
' sName - string; name of data '
' sValue - string; data value '
' WriteString("HKCU\Software\ES", "@", "http://www.elitesecurity.org") '
' NOTE: for editing '(Default)' data, as a name you may use '@' or simply left '
' the name parametar empty - "" (vbNullString) '
' Function returns: '
' 0 - if fails '
' handle of key in which is writed string data, if success '
' '
' [11] ReadString (Function) '
' Reads string data from registry '
' ReadString(sPath, sName, [Default]) As String '
' sPath - string; path to the key '
' sName - string; name of data to read '
' sDefault - string; optional parametar which will be returned if function fails'
' ReadString("HKCU\Software\ES", "Username", "krckoorascic") '
' Function returns: '
' sDefault parametar - if fails (maybe data or key doesn't exists) '
' string value if success '
' '
' [12] WriteDWORD (Function) '
' Writes/edits DWORD data type into registry '
' WriteDWORD(sPath, sName, lValue) As Long '
' sPath - string; path to the key '
' sName - string; name of data '
' lValue - long; value to be stored '
' WriteDWORD("HKCU\Software\ES", "AutoLogin", 1) '
' Function returns: '
' 0 - if there is an error '
' handle of key in which is writted dword data, if success '
' '
' [13] ReadDWORD (Function) '
' Reads dword data type from registry '
' ReadDWORD(sPath, sName, [lDefault]) As Long '
' sPath - string; path to the key '
' sName - string; name of data '
' lDefault - long; optional parametar (default -1) which will be returned if '
' function fails. '
' ReadDWORD("HKCU\Software\ES", "AutoLogin", 0) '
' Function returns: '
' lDefault parametar - on error '
' long value - if success '
' '
' [14] WriteBinary (Function) '
' Writes/edits Binary data type into registry '
' WriteBinary(sPath, sName, sValue) As Long '
' sPath - string; path to the key '
' sName - string; name of data '
' sValue - string; value that will be stored into registry. It MUST be in HEX '
' format, it's not needed to be uppercase and space after each two chars is not '
' needed (anything except "A-F", "0-9" i " "[space] is NOT valid!!) '
' WriteBinary("HKCU\Software\ES", "Password", "FF 20 3E 0B AF 00 00") '
' Function returns: '
' 0 - if there is an error '
' handle of key in which is writted dword data, if success '
' '
' [15] ReadBinary (Function) '
' Reads binary data type from registry '
' ReadBinary(sPath, sName, [sDefault]) As String '
' sPath - string; path to the key '
' sName - string; name of data '
' sDefault - string; optional (vbNullChar - Chr$(0)) which is returned if error '
' occurs... '
' ReadBinary("HKCU\Software\ES", "Password", "FF 20 3E 0B AF 00 00") '
' Function returns: '
' sDefault - if there is an error '
' string value if success '
' '
' [16] KillValue (Function) '
' Deletes any type data from registry '
' KillValue(sPath, sName) As Long '
' sPath - string; path to the key '
' sName - string; name of data '
' KillValue("HKCU\Software\ES", "Password") '
' Function returns: '
' 0 - if there is an error (value is NOT deleted) '
' handle of key where we killed the value... '
' '
' [17] ValueExists (Function) '
' Checks if some value (of any type) exists in registry database '
' ValueExists(sPath, sName) As Boolean '
' sPath - string; path to the key '
' sName - string; name of value that should be checked '
' ValueExists("HKCU\Software\ES", "Username") '
' Function returns: '
' True - if value exists in given key '
' False - if not exists '
' '
' [18] EnumValues (Function) '
' Returns arrays of names and values for all data in specified key '
' EnumValues(sPath, sName(), sValue(), [OnlyType]) As Long '
' sPath - string; path to the key '
' sName() - array (string) that will be populated with names of data '
' sValue() - array (variant) that will be populated with data values '
' OnlyType - rcRegType, optional parametar (REG_NONE - 0) which is filter for '
' reading values (if OnlyType = REG_SZ, only data of string type will be readed)'
' if this param is not given (REG_NONE) then all three data types are returned '
' NOTE: none of the arrays is NOT sorted. '
' EnumValues("HKCU\Software", Ime, Vrednost, REG_BINARY) '
' Function returns: '
' -1 - if there is an error '
' number of readed values (if success) '
' filled arrays (of names and values) that are 0-based... '
' '
' [19] ExportToReg (Function) '
' Generate .reg fole (same as Windows Registry Editor - Regedit) '
' ExportToReg(sPath, sRegFile [IncludeSubkeys], [Output]) As Long '
' sPath - string; path to the key where exporting starts '
' sRegFile - string; path to the file that will be generated (if file allready '
' exists then 0 is returned - error) '
' Output - TextBox object, optional. If TextBox is given then the name of key '
' thats currently reading will be displayed in this TextBox object (i added this'
' feature cuz exporting of realy large keys (like root keys) on slow machines '
' may take very long time to finish, you may use (use Change() event of textbox)'
' this to show user some progress... '
' IncludeSubkeys - boolean, optional (True). If set to false only contents of '
' given key will be exported, otherwise it will also return all values from all '
' subkeys of given key '
' ExportToReg("HKCU\Software\ES", "C:\ES.reg") '
' Function returns: '
' 0 - if there is an error '
' 1 - if .reg file is successufuly generated '
' '
' [20] generateReg (Private Function) '
' Private (recurzive) function that does real exporting(called from ExportToReg)'
' Function returns: '
' False - if there is an error '
' True - if key is readed successufuly (and written to file) '
' '
' [21] ImportFromReg (Function) '
' Imports .reg file in registry database (same as Regedit) '
' ImportFromReg(sRegFile) As Long '
' sRegFile - string; path to the .reg file '
' ImportFromReg("C:\ES.reg") '
' Function returns: '
' 0 - if there is an error (or file not exists) '
' 1 - if success '
' '
' [22] StrToBin (Private Function) '
' Used for WriteBinary function. Converts i.e "BE 3E FF AB" into "
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -