|
发表于 2015-4-20 03:26:21
|
显示全部楼层
本帖最后由 netegg 于 2015-4-20 09:56 编辑
来个快的
[au3]#include <SQLite.au3>
#include <SQLite.dll.au3>
Local $aResult, $iRows, $iColumns, $iRval
_SQLite_Startup()
;If @error Then
; MsgBox(16, "SQLite Error", "SQLite.dll Can't be Loaded!")
; Exit -1
;EndIf
_SQLite_Open() ; 打开:内存:数据库
;If @error Then
; MsgBox(16, "SQLite Error", "Can't Load Database!")
; Exit -1
;EndIf
_SQLite_Exec(-1, "CREATE TEMP table persons1(item, key);")
$i = 1
While 1
$key = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)
If $key = '' Then exitloop
_SQLite_Exec(-1, "INSERT INTO persons1 VALUES('" & $i & "','" & $key & "');")
$i += 1
WEnd
; 查询
$iRval = _SQLite_GetTable2d(-1, "SELECT * FROM persons1;", $aResult, $iRows, $iColumns)
if $iRval = $SQLITE_OK Then
_ArrayDisplay($aResult, "SQLite " & _SQLite_LibVersion() & " - Query Result")
endif
_SQLite_Close()
_SQLite_Shutdown()
[/au3] |
|