#Region ;**** 参数创建于 ACNWrapper_GUI ****
#PRE_Icon=..\5.ico
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
FileInstall("USkin.dll", @TempDir & "\USkin.Dll")
FileInstall("Skin.msstyles", @TempDir & "\Skin.msstyles")
$skins = @TempDir & "\Skin.msstyles"
$Dll_ = DllOpen(@TempDir & "\USkin.dll")
DllCall($Dll_, "int", "USkinInit", "str", "Null", "str", "NULL", "str", $skins)
DllCall($Dll_, "int", "USkinLoadSkin", "str", $skins)
#Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\新建文件夹\form1.kxf
$Form1_1 = GUICreate("车辆拍照登录", 782, 567, 316, 304)
$Label1 = GUICtrlCreateLabel("车牌号码", 16, 16, 68, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input1 = GUICtrlCreateInput("", 88, 16, 97, 21)
$Label2 = GUICtrlCreateLabel("号牌种类", 248, 16, 68, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input2 = GUICtrlCreateInput("", 320, 16, 97, 21)
$Label3 = GUICtrlCreateLabel("车主名字", 480, 16, 68, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input3 = GUICtrlCreateInput("", 560, 16, 209, 21)
$Label4 = GUICtrlCreateLabel("品牌种类", 16, 55, 68, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input4 = GUICtrlCreateInput("", 88, 55, 97, 21)
$Label5 = GUICtrlCreateLabel("发动机号", 248, 55, 68, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input5 = GUICtrlCreateInput("", 320, 55, 145, 21)
$Label6 = GUICtrlCreateLabel("车识别架码", 479, 55, 84, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input6 = GUICtrlCreateInput("", 568, 55, 201, 21)
$Label7 = GUICtrlCreateLabel("手机号码", 16, 90, 84, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input7 = GUICtrlCreateInput("", 88, 90, 130, 21)
$Label8 = GUICtrlCreateLabel("录入时间", 248, 90, 84, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Input8 = GUICtrlCreateInput("", 320, 90, 145, 21)
$Button1 = GUICtrlCreateButton("创 建", 23, 118, 73, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Button2 = GUICtrlCreateButton("查 看", 100, 118, 73, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Button3 = GUICtrlCreateButton("发 送", 331, 118, 73, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$Button4 = GUICtrlCreateButton("导出Excel", 408, 118, 75, 25)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
$ListView1 = GUICtrlCreateListView("序号|车牌号码|号牌种类|车主名字|发动机号|车识别架码|手机号码|录入时间", 4, 150, 775, 413)
GUICtrlSendMsg(-1, 0x101E, 0, 40)
GUICtrlSendMsg(-1, 0x101E, 1, 90)
GUICtrlSendMsg(-1, 0x101E, 2, 90)
GUICtrlSendMsg(-1, 0x101E, 3, 100)
GUICtrlSendMsg(-1, 0x101E, 4, 140)
GUICtrlSendMsg(-1, 0x101E, 5, 170)
GUICtrlSendMsg(-1, 0x101E, 6, 110)
GUICtrlSendMsg(-1, 0x101E, 7, 110)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$mdb_data_path = @ScriptDir & "\DetectData.mdb"
$mdb_data_pwd='vpte'
$adTable = "Receipt"
$t='*'
shuaxin()
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $Button1 ;新建数据库
If Not FileExists($mdb_data_path) Then
new()
Else
MsgBox(0,'关于···','本系统由云腾科技开发'&@CR&''&@CR&'版本:KF-0378-T1'&@CR&''&@CR&'@ 版权公有 传播不究')
EndIf
Case $Button2 ;查看
Case $Button3 ;写入新的记录
xieru()
Case $Button4 ;导出Excel表
EndSwitch
WEnd
Func shuaxin() ;刷新选择框
If Not FileExists($mdb_data_path) Then
$msg=MsgBox(1,'欢迎使用','没有找到数据库文件,是否创建?')
If $msg=1 Then
new()
Else
Exit
EndIf
EndIf
EndFunc
Func new() ;新建数据库和表
$time=@MIN&@SEC&'-'&@MDAY&@HOUR&'-'&@YEAR
$newMdb = ObjCreate('ADOX.Catalog')
$newMdb.Create("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd)
$newmdb.ActiveConnection.Close;建数据库
$addtbl = ObjCreate("ADODB.Connection")
$addTbl.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd)
$addTbl.Execute("CREATE TABLE " & $adTable)
$addtbl.Close;建表
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd)
$addfld.Execute("ALTER TABLE " & $adTable & " ADD id identity(1, 1) primary key,DET_PLATE text(255),DET_PCLASS text(255),DET_MINGZI text(255),DET_PINGPAI text(255),DET_FADONGJIHAO text(255),DET_VIN text(255),DET_HAOMA text(255),DET_DATE text(255)")
$addfld.Close;建列表名
MsgBox(0,'提示','数据库创建成功!'&@CR&''&@CR&'系统授权号:KF-'&$time&@CR&''&@CR&'@ 版权公有 传播不究')
EndFunc
Func xieru() ;往数据库中添加新的条目
If GUICtrlRead($Input1)<>'' And GUICtrlRead($Input3)<>'' And GUICtrlRead($Input4)<>'' And GUICtrlRead($Input5)<>'' And GUICtrlRead($Input6)<>'' And GUICtrlRead($Input7)<>'' And GUICtrlRead($Input8)<>'' Then
$read1=GUICtrlRead($Input1)
$read2=GUICtrlRead($Input2)
$read3=GUICtrlRead($Input3)
$read4=GUICtrlRead($Input4)
$read5=GUICtrlRead($Input5)
$read6=GUICtrlRead($Input6)
$read7=GUICtrlRead($Input7)
$read8=GUICtrlRead($Input8)
$addfld = ObjCreate("ADODB.Connection")
$addfld.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & $mdb_data_path & ";Jet Oledb:Database Password=" & $mdb_data_pwd) ;要写数据,首先要连接到数据库
$addfld.Execute("insert into "&$adTable&"DET_PLATE,DET_PCLASS,DET_MINGZI,DET_PINGPAI,DET_FADONGJIHAO,DET_VIN,DET_HAOMA,DET_DATE) values('"&$read1&"','"&$read2&"','"&$read3&"','"&$read4&"','"&$read5&"','"&$read6&"','"&$read7&"','"&$read8&"')") ;这里是告诉数据库要写到什么位置。要写什么值,
$addfld.close ;写完结束所有的连接
Else
MsgBox(48, "提示", "添加失败,请检查项目填写格式是否正确!如无数值请输入:nul或无")
GUICtrlSetState($Input5,$GUI_FOCUS)
EndIf
EndFunc
Func Quit()
GUISetState(@SW_HIDE) ;这里先将界面隐藏起来,因为要先关闭皮肤后才关闭软件,所以隐藏界面后关闭皮肤的话就不会看到没有皮肤的界面了。
DllCall($Dll_, "int", "USkinRemoveSkin") ;这里是关闭皮肤
DllCall($Dll_, "int", "USkinExit") ;这里是退出皮肤调用的DLL
DllClose($Dll_) ;关闭DLL文件调用
FileDelete( @TempDir & "\Skins\Skin.msstyles") ;删除临时目录里面的皮肤文件
FileDelete(@TempDir & "\Uskin.dll") ;删除临时目录里面的USkin.dll文件
Exit ;退出脚本(关闭软件)
EndFunc ;==>Quit