Solved

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

Posted on 2009-06-29
7
1,470 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access Web appliction 7 48
Red error squiggly on vb.net 7 27
How to save a picture box in a specific network folder using vb.net 2013 7 26
Linq Help 1 35
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

896 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now