Mengetahui
jumlah memory di komputer yang Anda gunakan.
Code::
|
'Deskripsi: Mengetahui utilitas jumlah memori di suatu PC 'Persiapan: 1. Buat 1 Project baru dengan 1 Form, 1 Module, ' dan 1 Commandbutton.
' 2. Copy-kan coding berikut ke editor form yang bertalian.
--------------------------------------------------------------------- '--- Coding ini di Module... Public Type MEMORYSTATUS
dwLength As Long
dwMemoryLoad As Long
dwTotalPhys As Long
dwAvailPhys As Long
dwTotalPageFile As Long
dwAvailPageFile As Long
dwTotalVirtual As Long
dwAvailVirtual As Long
End Type
Public Declare Sub GlobalMemoryStatus Lib "kernel32" (lpBuffer As MEMORYSTATUS)
'--- Akhir coding di Module...
'--- Coding ini di Form...
Private Sub Command1_Click()
Dim MS As MEMORYSTATUS
MS.dwLength = Len(MS)
GlobalMemoryStatus MS
'MS.dwMemoryLoad contains percentage memory used
'MS.dwTotalPhys contains total amount of physical memory in bytes
'MS.dwAvailPhys contains available physical memory
'MS.dwTotalPageFile contains total amount of memory in the page file
'MS.dwAvailPageFile contains available amount of memory in the page file
'MS.dwTotalVirtual contains total amount of virtual memory
'MS.dwAvailVirtual contains available virtual memory
MsgBox "Berikut Informasi Memori di Komputer Anda:" & vbCrLf & _
"" & vbCrLf & _
"Memori Fisik Tersedia = " & Format(MS.dwAvailPhys, "#,#") & vbCrLf & _
"Persentase Memori Digunakan = " & Format(MS.dwMemoryLoad, "#,#") & "%" & vbCrLf & _
"Total Memori Fisik dalam Bytes = " & Format(MS.dwTotalPhys, "#,#") & vbCrLf & _
"Total Memori dalam File = " & Format(MS.dwTotalPageFile, "#,#") & vbCrLf & _
"Total Memori Tersedia di File = " & Format(MS.dwAvailPageFile, "#,#") & vbCrLf & _
"Total Virtual Memori = " & Format(MS.dwTotalVirtual, "#,#") & vbCrLf & _
"Total Virtual Memori Tersedia = " & Format(MS.dwAvailVirtual, "#,#"), vbInformation
End Sub
'--- Akhir coding di Form.. |
0 komentar:
Posting Komentar