Latest topics
» [Code] Kiểm tra kết nối mạngby jameseshell Fri Jul 31, 2015 3:29 pm
» AutoClick không chiếm chuột
by jameseshell Fri Jul 31, 2015 9:58 am
» [Sorf] Connect/Disconet Button
by thanhhan31 Fri Jun 26, 2015 3:56 am
» Giới thiệu ngôn ngữ lập trình Autoit
by vanhoa1402 Mon Jun 08, 2015 12:40 am
» [Code] Đếm ngược thời gian
by satoh290801 Sat Jun 06, 2015 10:11 am
» Debug game online
by cheater Mon Jun 01, 2015 3:15 pm
» [Thắc Mắc] cách nhập xuất dữ liệu
by cadilacst Mon Apr 27, 2015 7:14 am
» [Code] Auto Win 2c6f td1 - sv HN
by Hades Wed Jan 14, 2015 5:41 am
» [Hỏi] AutoIt với CSDL online?
by todzin Wed Nov 19, 2014 11:14 pm
» [Hỏi] Một số vấn đề về Copy & Paste file bằng ứng dụng thứ 3 (Everything.exe)
by aloatiso Tue Nov 11, 2014 10:31 pm
» Click theo điểm ảnh !
by nhatdaica055 Wed Oct 15, 2014 5:17 pm
» Nội quy diễn đàn
by lethusinh01 Fri Sep 12, 2014 3:59 am
» Hide Windows !!!
by Sweetsica Fri Aug 08, 2014 2:31 am
» Cài đặt , sử dụng và biên dịch Autoit
by mankichi Thu Jul 24, 2014 5:11 am
» Tuyển mod cho diễn đàn
by huynhlamid Fri Jan 17, 2014 3:36 pm
» PixelSearch - Quét (hay kiểm tra) điểm ảnh
by vanthang Fri Jan 17, 2014 5:49 am
» Thiệp Cực Đẹp Tặng Người Yêu !!!
by Nokia3G Mon Dec 23, 2013 12:50 pm
» Lấy đường dẫn của phần mềm chạy ngầm
by cuongkoken Sat Dec 21, 2013 1:25 am
» Xin Admin giup do
by xlove_bmt Wed Dec 18, 2013 6:40 am
» [Hỏi] Cần pro chỉ làm trainer game!
by quytucaca Wed May 29, 2013 7:43 am
[Soft] LOOKDISKS - Check thông tin ổ đĩa
Trang 1 trong tổng số 1 trang
[Soft] LOOKDISKS - Check thông tin ổ đĩa
- Code:
#include <GUIConstantsEx.au3>
#include <Misc.au3>
#include <Array.au3>
#include <File.au3>
Global $mem,$drive,$dt,$e,$file,$text,$t
$mem=MemGetStats()
$g=GUICreate('LOOKDISKS',320,500,@DesktopWidth-330,60,BitOR(0x00020000,0x00C00000,0x80000000,0x00080000),0x00000018)
$b1=GUICtrlCreateButton('TỔNG RAM: '&Round($mem[1]/1024,1) & ' MB',10,10,300,40)
GUICtrlSetColor(-1,0x094584)
$b2=GUICtrlCreateButton('RAM CÒN: '&Round($mem[2]/1024,1) & ' MB',10,60,300,40)
GUICtrlSetColor(-1,0x094584)
$b3=GUICtrlCreateButton('ĐANG SỬ DỤNG: '&$mem[0]& ' %',10,110,300,40)
GUICtrlSetColor(-1,0x094584)
$e=GUICtrlCreateListView('Name|Label|Filesys|Serial|Type',10,160,300,200)
GUICtrlSetColor(-1,0xff0000)
$b6=GUICtrlCreateInput('',10,370,300,25)
GUICtrlSetState(-1,$GUI_DROPACCEPTED)
$b4=GUICtrlCreateButton("GO>>>",50,430,100,50)
$b5=GUICtrlCreateButton('CHECK>>>',170,430,100,50)
$d=DriveGetDrive("all")
$dt=$d[0]
For $i=1 to $d[0]
GUICtrlCreateListViewItem(StringUpper($d[$i])&'|' & DriveGetLabel($d[$i])&'|'&DriveGetFileSystem($d[$i])&'|'&DriveGetSerial($d[$i])&'|'&DriveGetType($d[$i]),$e)
Next
;;==> END
_FileCreate(@MyDocumentsDir&'\diskcare.txt')
If @error Then
Exit
Else
$file=@MyDocumentsDir&'\diskcare.txt'
EndIf
Func _check()
Local $item=GUICtrlRead($e),$f
$f=FileOpen($file,2)
If $f = -1 Then
MsgBox(0, "Error", "Unable to open file.")
Exit
EndIf
$text=StringMid(GUICtrlRead($item),1,2)&''
FileWrite($f,$text)
FileClose($f)
;==>FILE
If $item=0 Then
MsgBox(0,'THONG BAO','Ban chua chon o dia can kiem tra file autorun.inf')
ElseIf FileExists(StringMid(GUICtrlRead($item),1,2)&'\autorun.inf') Then
MsgBox(0,'THONG BAO','Ổ '&StringMid(GUICtrlRead($item),1,2)&' tồn tại Autorun.inf')
; Shows the filenames of all files in the current directory.
$search = FileFindFirstFile(StringMid(GUICtrlRead($item),1,2)&"\*.*")
; Check if the search was successful
If $search = -1 Then
MsgBox(0, "LOI", "Khong co file/folder phu hop")
Exit
EndIf
Dim $array[1]
$i=0
Do
$file=FileFindNextFile($search)
$array[$i]=$file
If @error Then ExitLoop
$i=$i+1
ReDim $array[$i+1]
Until @error
ReDim $array[$i]
FileClose($search)
MsgBox(0,'THONG BAO','Co tat ca '&$i&' files/folders trong thu muc '&StringMid(GUICtrlRead($item),1,2)&'')
_ArrayDisplay($array,StringMid(GUICtrlRead($item),1,2)&'')
Else
MsgBox(0,'THONG BAO','Ổ '&StringMid(GUICtrlRead($item),1,2)&' không tồn tại Autorun.inf')
EndIf
EndFunc
Func _drive()
GUICtrlDelete($e)
$e=GUICtrlCreateListView('Ten|Label|Filesys|Serial|Type',10,160,300,260)
GUICtrlSetColor(-1,0xff0000)
$dt=$ds[0]
For $i=1 to $ds[0]
GUICtrlCreateListViewItem(StringUpper($ds[$i])&'|' & DriveGetLabel($ds[$i])&'|'&DriveGetFileSystem($ds[$i])&'|'&DriveGetSerial($ds[$i])&'|'&DriveGetType($ds[$i]),$e)
Next
EndFunc
Func _go()
Local $n_item=GUICtrlRead($e)
If $n_item=0 Then
MsgBox(0,'Thong bao','Bạn chưa chọn ổ đĩa nào')
Else
ShellExecute(StringMid(GUICtrlRead($n_item),1,2)&'')
EndIf
EndFunc
GUISetState()
$k=0
While 1
Sleep(10)
Local $mem1=MemGetStats(),$ds=DriveGetDrive("all")
If $ds[0] <> $dt Then
If $ds[0]<$dt Then
MsgBox(0,'THONG BAO','1 Drive OUT')
_drive()
ElseIf $ds[0]>$dt Then
MsgBox(0,'THONG BAO','1 Drive IN')
_drive()
EndIf
EndIf
GUICtrlSetData($b2,'RAM CÒN: '&Round($mem1[2]/1024,1) & ' MB')
GUICtrlSetData($b3,'ĐANG SỬ DỤNG: '&$mem1[0]& ' %')
If WinActive('LOOKDISKS') Then
If _IsPressed(20) or _IsPressed('0d') Then
Sleep(10)
_go()
ElseIf _IsPressed('54') Then
Sleep(10)
_check()
EndIf
EndIf
If (GUICtrlRead($b6)<>'' And $k=0) Then
$t=GUICtrlRead($b6)
ClipPut($t)
$k=1
ElseIf GUICtrlRead($b6)<>$t And $k=1 Then
$t=GUICtrlRead($b6)
ClipPut($t)
$k=1
EndIf
$msg=GUIGetMsg()
Switch $msg
Case $gui_event_close
Exit
Case $b4
_go()
Case $b5
_check()
EndSwitch
WEnd
Similar topics
» [Soft] PC-WH 1.1 - Tiệc ích máy tính
» [Soft] Hẹn giờ tắt máy
» [Soft] Mã hóa file
» [Soft] Hẹn giờ tắt máy đơn giản
» [Soft] Mã hóa file text
» [Soft] Hẹn giờ tắt máy
» [Soft] Mã hóa file
» [Soft] Hẹn giờ tắt máy đơn giản
» [Soft] Mã hóa file text
Trang 1 trong tổng số 1 trang
Permissions in this forum:
Bạn không có quyền trả lời bài viết
|
|