decrypt Posted March 22, 2004 Posted March 22, 2004 I've tried figureing this out but does anyone know how to get the amount of memory being used (in percentage), the total amount of memory, and the available memory? Quote
decrypt Posted March 23, 2004 Author Posted March 23, 2004 I got this for vb6: Dim ms As MEMORYSTATUS Dim msg As String ' query for memory data ms.dwLength = Len(ms) GlobalMemoryStatus ms ' create a result message. msg = "Total physical memory = " & GetKbytes(ms.dwTotalPhys) & vbCrLf & _ "Available physical memory = " & GetKbytes(ms.dwAvailPhys) & vbCrLf & _ "Memory Load = " & ms.dwMemoryLoad & "%" & vbCrLf & _ "Total Page file = " & GetKbytes(ms.dwTotalPageFile) & vbCrLf & _ "Available Page file = " & GetKbytes(ms.dwAvailPageFile) & vbCrLf & _ "Total Virtual memory = " & GetKbytes(ms.dwTotalVirtual) & vbCrLf & _ "Available Virtual memory = " & GetKbytes(ms.dwAvailVirtual) MsgBox msg, vbInformation, "Memory information" 'The GetKbytes function is a simple routine that converts a number of bytes into Kbytes, and adds thousand separators: ' Format a memory amoung as a Kbyte or Megabyte Function GetKbytes(ByVal amount As Long) As String ' convert to Kbytes amount = amount \ 1024 GetKbytes = Format(amount, "###,###,###K") End Function The problem is that it's in vb6, and i need vb.net Quote
CattleRustler Posted March 23, 2004 Posted March 23, 2004 There are Performance Counter Objects that are perfect for this. It's a vast topic so look in the Help. :) Quote mod2software Home of the VB.NET Class Builder Utility - Demo and Full versions available now!
decrypt Posted March 24, 2004 Author Posted March 24, 2004 Thanks alot i thought noone would reply :) Quote
Administrators PlausiblyDamp Posted March 24, 2004 Administrators Posted March 24, 2004 Not sure what you searched on to fail to find any reference but have a look Here Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.