SourceCoders Posted October 4, 2003 Posted October 4, 2003 Who can tell me what functions this dll supports ? I need a function which tells me the total physical memory. And I need a hint how can I use this functions and how i bind it in my code. Please fast, is it urgent !!!!! Or where I can find a complete list of the dll functions. Thanks Quote
aewarnick Posted October 4, 2003 Posted October 4, 2003 You'll get better results just using google and looking it up. Quote C#
*Experts* mutant Posted October 4, 2003 *Experts* Posted October 4, 2003 http://www.allapi.net contains the most commonly used API declarations and a description for them. For memory you could try using the GlobalMemoryStatusEx API. Remeber: That site contains declarations for VB6 so you have to change all declarations As Long to As Integer because VB6's Long is equal to .NET's Integer. Quote
Mark Posted October 5, 2003 Posted October 5, 2003 Private objCS As ManagementObjectSearcher Private objMgmt As ManagementObject Public m_strTPM As String Public Sub memory() objCS = New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem") For Each objMgmt In objCS.Get m_strTPM = objMgmt("totalphysicalmemory").ToString() Next End Sub I hope this help. Bye Quote
Mark Posted October 5, 2003 Posted October 5, 2003 Imports System.Management Sorry, i forgot this. Quote
SourceCoders Posted October 6, 2003 Author Posted October 6, 2003 That i've tried to , but there is no class System.Management Searched also in System.Environment... but also false ! Quote
*Experts* Bucky Posted October 6, 2003 *Experts* Posted October 6, 2003 You need to go to the Project menu -> References, and add a reference to the System.Management DLL in your project. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
Mark Posted October 6, 2003 Posted October 6, 2003 That i've tried to , but there is no class System.Management Searched also in System.Environment... but also false ! Sorry friend :( I forgot to say you to add a reference to the correct dll. Sorry again Quote
SourceCoders Posted October 7, 2003 Author Posted October 7, 2003 THX a lot my friends.... it works.... i am just a beginner in VB .NET but with your help i will learn it to be better .... Now my last question: Wer i can find a listing of all these infos SELECT * FROM Win32_ComputerSystem objMgmt("totalphysicalmemory").ToString() Why do you know that the TotalMemory is written in WIN32_ComputerSystem and there in "totalphysicalmemory" ??? is there a list or something ? Quote
Mark Posted October 7, 2003 Posted October 7, 2003 I hope this help Try here :) It is not a complete list of infos you seek for, but i hope this may help you. Quote
SourceCoders Posted October 8, 2003 Author Posted October 8, 2003 Thank u very much u are the best ;-) Quote
Mark Posted October 8, 2003 Posted October 8, 2003 Naaaaaa i'm not the best! Simply i have looked for this informations a week before you :D Good coding ! Quote
Recommended Posts