
Forma şunları ekleyim;
1 tane TextBox
1 tane Button
Kodlama;
Imports System.Runtime.InteropServices Public Class Form1 <DllImport("Kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> Public Shared Function GlobalMemoryStatusEx(ByRef IpBuffer As MEMORYSTATUEX) As <MarshalAs(UnmanagedType.Bool)> Boolean End Function <StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Auto)> Public Structure MEMORYSTATUEX Public dwLength As UInteger Public dwMemoryLoad As UInteger Public ullTotalPhys As ULong Public ullAvailPhys As ULong Public ullTotalPageFile As ULong Public ullAvailPageFile As ULong Public ullTotalVirtual As ULong Public ullAvailVirtual As ULong Public ullAvailExtendedVirtual As ULong End Structure Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim hafıza As New MEMORYSTATUEX() hafıza.dwLength = 64 Dim b As Boolean = GlobalMemoryStatusEx(hafıza) TextBox1.Text = TextBox1.Text + "Kullanılan Bellek Mikterı= " & (hafıza.dwMemoryLoad) & vbCrLf TextBox1.Text = TextBox1.Text + "Toplam Bellek Miktarı= " & (hafıza.ullTotalPhys (1024 * 1024)) & " mb" & vbCrLf TextBox1.Text = TextBox1.Text + "Boş Bellek Miktarı= " & (hafıza.ullAvailPhys (1024 * 1024)) & " mb" & vbCrLf TextBox1.Text = TextBox1.Text + "Toplam Page File Miktarı= " & (hafıza.ullTotalPageFile (1024 * 1024)) & " mb" & vbCrLf TextBox1.Text = TextBox1.Text + "Boş Page File= " & (hafıza.ullAvailPageFile (1024 * 1024)) & " mb" & vbCrLf TextBox1.Text = TextBox1.Text + "Toplam Sanal Bellek Miktarı= " & (hafıza.ullTotalVirtual (1024 * 1024)) & " mb" & vbCrLf TextBox1.Text = TextBox1.Text + "Boş Sanal Bellek Miktarı= " & (hafıza.ullAvailVirtual (1024 * 1024)) & " mb" End Sub End Class
ads
Hiç yorum yok: