AndreRyan Posted June 11, 2003 Posted June 11, 2003 (edited) I found this API Private Declare Sub GetSystemInfo Lib "kernel32.dll" (ByRef lpSystemInfo As SYSTEM_INFO) Private Structure SYSTEM_INFO Public dwOemID As Int32 Public dwPageSize As Int32 Public lpMinimumApplicationAddress As Int32 Public lpMaximumApplicationAddress As Int32 Public dwActiveProcessorMask As Int32 Public dwNumberOrfProcessors As Int32 Public dwProcessorType As Int32 Public dwAllocationGranularity As Int32 Public dwReserved As Int32 End Structure Edited June 11, 2003 by AndreRyan Quote .Net allows software to be written for any version of Windows and not break like Unmanaged applications unless using Unmanaged procedures like APIs. If your program uses large amounts of memory but releases it when something else needs it, then what's the problem?
aewarnick Posted June 11, 2003 Posted June 11, 2003 Api calls can be used in almost if not any programming language. Quote C#
Asso79 Posted June 11, 2003 Author Posted June 11, 2003 After that i write the code how can i use for dwProcessorType ? Thanks Quote
aewarnick Posted June 11, 2003 Posted June 11, 2003 I don't know. Try some things: IntPtr ptr = GetSystemInfo.SYSTEM_INFO.dwProcessorType; That is C# syntax. Fool around a little and you will probably get it. By the way, you need to copy and paste AndreRyan's code into your app first. Quote C#
a_jam_sandwich Posted June 11, 2003 Posted June 11, 2003 http://www.csharphelp.com/archives/archive79.html has a article on this API Andy Quote Code today gone tomorrow!
Asso79 Posted June 13, 2003 Author Posted June 13, 2003 It's ok for c but for vbasic net is different Quote
Leaders dynamic_sysop Posted June 13, 2003 Leaders Posted June 13, 2003 Private Declare Sub GetSystemInfo Lib "kernel32.dll" (ByRef lpSystemInfo As SYSTEM_INFO) Private Structure SYSTEM_INFO Public dwOemID As Int32 Public dwPageSize As Int32 Public lpMinimumApplicationAddress As Int32 Public lpMaximumApplicationAddress As Int32 Public dwActiveProcessorMask As Int32 Public dwNumberOrfProcessors As Int32 Public dwProcessorType As Int32 Public dwAllocationGranularity As Int32 Public dwReserved As Int32 End Structure Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim s As SYSTEM_INFO GetSystemInfo(s) MsgBox(s.dwProcessorType & Chr(10) & s.dwNumberOrfProcessors & Chr(10) & s.dwPageSize) End Sub Quote
Recommended Posts