Solved

how to get  all information of task manager using vb.net

Posted on 2009-06-29
7
1,772 Views
Last Modified: 2012-06-27
i want to obtain the total physical memory and available physical memory
which is display on task manager in performance tab and the list of process with memory usage which is currently running on the task manager in process tab in vb.net application


0
Comment
Question by:mrpatil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 24742832
To retrieve the process-information, you need something like this:
Dim poc() as process = process.getprocesses()
for i as integer = 0 to poc.length - 1
if poc(i).processname.tostring <> "system" or poc(i).processname.tostring <> "idle" then
try
lstview.items.add(environment.machinename)
lstview.items(i).subitems.add(poc(i).processname)
lstview.items(i).subitems.add(poc(i).mainmodule.filename)
lstview.items(i).subitems.add(poc(i).mainwindowtitle)
catch ex as exception
msgbox(poc(i).processname.tostring & " " & ex.message)
end try
end if
next 

Open in new window

0
 

Author Comment

by:mrpatil
ID: 24763156
this code not give the specific running process list and available and total physical memory
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 24763328
Memory usage
------------------

Dim p As Process
For Each p In p.GetProcesses
  lblMemUsage.Text = p.ToString.Remove(0, 27).ToLower & " " & (p.WorkingSet / 1024).ToString("0,000") & " K"
Next
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 53

Expert Comment

by:Dhaest
ID: 24763334
VB.Net: Getting memoryusage of one process
http://wiki.lessthandot.com/index.php/VB.Net:_Getting_memoryusage_of_one_process
Public Shared Function GetMemoryUsage(ByVal ProcessName As String) As String 
            Dim _Process As Process = Nothing 
            Dim _Return As String = "" 
            For Each _Process In Process.GetProcessesByName(ProcessName) 
                If _Process.ToString.Remove(0, 27).ToLower = "(" & ProcessName.ToLower & ")" Then 
                    _Return = (_Process.WorkingSet64 / 1024).ToString("0,000") & " K" 
                End If 
            Next 
            If Not _Process Is Nothing Then 
                _Process.Dispose() 
                _Process = Nothing 
            End If 
            Return _Return 
        End Function

Open in new window

0
 

Author Comment

by:mrpatil
ID: 24763478
this code not give available physical size & total physical size(i.e. display on the task manager in performance tab)
0
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 24763553
You'll need to take several small examples of code together to get all that you want. I don't think that there is already a tool available that has all the things that you want...

Some things you can use to recreate the taskmanager
Memory Monitor (VB.NET 1.1)
http://www.freevbcode.com/ShowCode.asp?ID=5920

Process-tab: Examples given above
Memory-information:
http://www.java2s.com/Code/VB/Windows-System/Gettotalmemory.htm
http://vbnet.mvps.org/index.html?code/system/globalmemory.htm
0
 

Author Closing Comment

by:mrpatil
ID: 31598232
now please give the list of process which are running in the task manager with name of process and use of cpu and memory
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question