Movatterモバイル変換


[0]ホーム

URL:


VB.Net Tutorial
  1. .Net Framework
  2. VB.Net Basics
  3. VB.Net Program Flow
  4. VB.Net GUI
  5. VB.Net Collections
  6. VB.Net Strings
  7. VB.Net Files
  8. VB.Net Excel
  9. VB.Net Crystal Reports
  10. VB.Net Networking
  11. VB.Net ADO.NET
  12. VB.Net Data Providers
  13. VB.Net Dataset
  14. VB.Net DataAdapter
  15. VB.Net DataView
  16. VB.Net Remoting
  17. VB.Net XML
  18. VB.Net DataGridView
  19. VB.Net Advanced
  20. VB.Net Essentials

VB.NET Running Process List

By:Rajesh P.S.

The Process component is a powerful tool for managing applications, providing functionalities to start, stop, control, and monitor them. It is a part of the System.Diagnostics namespace, which offers a range of classes for interacting with system processes, event logs, and performance counters.

Imports System.Diagnostics

In addition to retrieving lists of running processes or viewing information about the process that currently has access to the processor, you can get detailed knowledge of process threads and modules both through the Process class itself.

Dim plist() As Process = Process.GetProcesses()

Process component

With the Process component, developers can perform various operations related to system processes. This includes retrieving lists of running processes, accessing detailed information about a specific process, controlling its execution, and monitoring its performance.

In addition to obtaining general information about a process, such as its ID, name, and resource usage, the Process class also provides insights into process threads and modules. Threads represent individual units of execution within a process, and modules are the loaded libraries or code files associated with the process. By utilizing the Process class, developers can access detailed knowledge of threads and modules, enabling them to gain a deeper understanding of the process's behavior and structure.

The following VB.NET program shows how to retrieve the process name and Memory Allocation of each process from a running system. Drag and drop a Button and ListBox control on your VB.NET Form, and copy and paste the following source code on button click event.

Full Source VB.NET
Imports System.DiagnosticsPublic Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim plist() As Process = Process.GetProcesses() For Each prs As Process In plist ListBox1.Items.Add(prs.ProcessName + " (" + prs.PrivateMemorySize64.ToString() + ")") Next End SubEnd Class

Conclusion

To optimize performance and minimize unnecessary resource consumption, the Process component intelligently caches information. When information about one member of a group (e.g., process threads or modules) is obtained, the values for the other properties in that group are cached. This means that subsequent accesses to those properties will not trigger new information retrieval unless the Refresh method is explicitly called. This caching mechanism ensures efficient access to process-related information without unnecessary overhead.




Next >  Single instance of VB.NET application


  1. What is Microsoft .Net Framework
  2. what are the functions of microsoft .net framework?
  3. Common Language Runtime in .Net Framework
  4. How Does CLR Work In Dot NET Framework
  1. What is .Net Framework Class Library
  2. What is Common Language Specification
  3. What is Common Type System
  4. What is Microsoft Intermediate Language
  5. What is Portable Executable (PE) File Format
  6. What is Microsoft Just In Time Compiler
  7. How to Managed Code - Microsoft .Net Framework
  8. What is .Net Framework Metadata
  9. what is .Net Framework Assembly
  10. What is Assembly Manifest
  11. What is Global Assembly Cache
  12. What is a .Net Satellite Assembly?
  13. What are the contents of an Assembly?
  14. How to Private Assembly and Shared Assembly
  15. What is Microsoft .Net Strong Name
  16. What is .Net Namespaces
  17. What is Application Domain
  18. What is Code Access Security
  19. What is Garbage Collection
  20. .Net Threads

Related Links
  1. Single instance of VB.NET application
  2. Assemblies in a domain - VB..NET
  3. VB.NET Registry Operations




[8]ページ先頭

©2009-2025 Movatter.jp