AU3-私人保险柜控制端
#include <GUIConstants.au3>#Include <GuiStatusBar.au3>
#include <GuiListView.au3>
#include <string.au3>
#include <file.au3>
Dim $tpmeba
Global $k=0,$s=0
Local $a_PartsRightEdge[3] = [100, 350, -1]
Local $a_PartsText[3] = ["New Text", "More Text", "Even More Text"]
$lj=formatPath('d:\temp')
$gui=GUICreate("网吧私人保险柜控制端",438,415, -1,-1)
GUISetBkColor (0x00E0FFFF) ; 更改背景颜色
$sta=GUICtrlCreateMenu ("选项(&R)")
$start=GUICtrlCreateMenuitem ("清理用户(&T)",$sta)
$listview = GUICtrlCreateListView ("用户名称 |占用大小 |注册时间 |最后登陆 ",1,0,436,350)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUICtrlSendMsg($listview, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
$Status = GUICtrlCreateLabel("", 5, 355, 200, 15)
$noto=GUICtrlCreateButton("上一页", 330, 351, 50,21,$BS_FLAT)
$net=GUICtrlCreateButton("下一页", 385, 351, 50,21,$BS_FLAT)
$shuzhe=GUICtrlCreateLabel("注册帐号", 235, 65, 50,17,$SS_NOTIFY)
$StatusBar1 = _GUICtrlStatusBarCreate ($gui, $a_PartsRightEdge, $a_PartsText)
GUICtrlSetState ($noto,$GUI_DISABLE)
GUICtrlSetState ($net,$GUI_DISABLE)
GUISetState()
$search = FileFindFirstFile($lj&'*.*')
;$tpmeba=_TempFile()
$tpmeba='d:\dd.Log'
If $search <> -1 Then
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
If FileExists($lj&$file&'\users.dat') Then
$k=$k+1
$shushejf=IniRead($lj&$file&'\users.dat',"参数","注册时间","")
$tenglujf=IniRead($lj&$file&'\users.dat',"参数","最后登录","")
$hy=Round(DirGetSize($lj&$file)/1048576,2)
FileWriteLine ($tpmeba, ' '&$file&'| '&$hy&' MB| '&$shushejf&'| '&$tenglujf)
If $k <= 25 Then
GUICtrlCreateListViewItem(' '&$file&'| '&$hy&' MB| '&$shushejf&'| '&$tenglujf, $listview)
EndIf
EndIf
WEnd
EndIf
FileClose($search)
GUICtrlSetState ($noto,$GUI_DISABLE)
If $k > 25 Then GUICtrlSetState ($net,$GUI_ENABLE)
GUICtrlSetData($Status,'共有'&$k&'个注册用户')
While 1
$msg = GUIGetMsg ()
Select
Case $msg = $noto
$s=$s-(_GUICtrlListViewGetItemCount ($listview)+25)
If $s <= 25 Then GUICtrlSetState ($noto,$GUI_DISABLE)
GUICtrlSetState($net, $GUI_ENABLE)
Dim $l=0
_netdate()
Case $msg = $net
If $s<=25 Then $s=26
GUICtrlSetState($noto, $GUI_ENABLE)
Dim $l=0
_netdate()
Case $msg = $GUI_EVENT_CLOSE
FileDelete($tpmeba)
Exit
EndSelect
WEnd
Func xiaMM($xmm);加密
Return _StringEncrypt(1,$xmm,"qingui2007tysvbaofeng2","2")
EndFunc
Func qieMM($qmm);解密
Return _StringEncrypt(0,$qmm,"qingui2007tysvbaofeng2","2")
EndFunc
Func formatPath($m_path) ;加\
Dim $m_p=$m_path
While 1
If StringRight($m_p, 1)="\" Or StringRight($m_p, 1)="/" Then
$m_p=StringTrimRight($m_p, 1)
Else
ExitLoop
EndIf
WEnd
Return $m_p&'\'
EndFunc
Func _netdate()
_GUICtrlListViewDeleteAllItems ($listview)
While 1
$line = FileReadLine($tpmeba,$s)
$s=$s+1
GUICtrlCreateListViewItem($line, $listview)
$l=$l+1
If $l=25 Then ExitLoop
Wend
If $s >= $k Then GUICtrlSetState($net, $GUI_DISABLE)
EndFunc
页:
[1]