Solved

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

Posted on 2009-06-29
7
1,440 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

744 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