- 热门文章:
- · 开心,捕捉子线程内异常的例子
- · The key to multi-threaded Windows Forms UI interaction(ZT)
- · 使用 Visual Basic .NET 进行多线程编程(转自MSDN)续
- · 使用 Visual Basic .NET 进行多线程编程(转自MSDN)
- · VB.NET多线程开发实例(转)
- · 在.Net中监控Processes和Threads(2)
- · 提供一个:用多线程模拟多用户访问站点情况!
- · thread pool
- · 在.Net中监控Processes和Threads(1)
- · Custom Thread Pooling Template
- · 把昨天写的东西的代码公布出来。哎。。真恶心。
- · C#算法-----(一)选择排序
上一篇:初识C#线程 >>
用VB.NET获得系统进程列表
VB.NET relieves us from all such problems by providing class libraries to access system resources and environment information. Here is a simple example In VB.NET, that depicts the method to get the list of of processes that are currently running in your system.
1) Place a button in the form
2) Place a TextBox in the Form and name it as txtProcesses
3) Set the Multi-line property of the TextBox(txtProcesses) to True
4) Import the System namespace
5) Write the following code in the CommandButton click Event
Dim sProcesses() As System.Diagnostics.Process
Dim sProcess As System.Diagnostics.Process
Dim s As String
On Error Goto ErrorHandler
sProcesses = System.Diagnostics.Process.GetProcesses()
s = ""
s = vbCrLf & "Procss Info " & vbCrLf
For Each sProcess In sProcesses
s = s & sProcess.Id & Space(5) & sProcess.ProcessName() & vbCrLf
Next
txtProcesses.Text = s
ErrorHandler:
MsgBox "Unexpected Error occurred"
System.Diagnostics.Process is NameSpace provides the method GetProcesses() to get the list of process running in your system. This function returns Object array of type Process. The ID and ProcessName properties of the Process object can be used to retrive the ProcessID(PID) and the Name process.
The overloaded function GetProcesses with << System Name >> parameter can be invoked to get list of processes running in a remote system.
Happy programming with VB.NET.
下一篇:开心,捕捉子线程内异常的例子 >>
相关文章:
- · C#算法----(二)插入排序
- · C#算法----(三)希尔排序
- · C#算法-------(四)快速排序
- · C#算法----(三)希尔排序 (solarsoft原创)
- · C#算法----(二)插入排序 (solarsoft原创)
- · 从csdn上看到的一些文章,好象有人转过,再转一次吧——C#算法-----(一)选择排序 (solarsoft原创)
- · 恢复URL字符串
- · 是不是这个?
- · C#小游戏-------猜数字 (solarsoft原创)
- · 简繁体转换例程
- · 给你一个MD5算法
- · 如何获得一个6位长随机数
- · 关于字符窜和数字分离
- · 密码的故事 (ST:MS,Author:Billy Hollis )
- · 呵呵,泼点儿凉水。
- · 将字符串中的数字和字符分离的技术例如(the9 city)分解成(the city)和9
- · LinkedQueue的实现
- · C#的BinaryTree实现
- · 给贝贝的,Base64编码(带有Q和B编码)——VB.NET
- · Huffman with Short dictionary压缩算法(VB.NET Source)
- · 上面提到的原代码(C语言)—1
- · 上面提到的原代码(C语言)—2
- · 找到了,JPG格式原理。
- · Huffman 编码简介(讲解的更好一些,有C的分析)
- · Huffman编码原理
- · 浅谈图像压缩算法(好文章。看看吧。再别说不了解JPG的原理了)
- · A Good 31 bit Random Number Generator Class
- · 一棵C#写的树(1) he_x(原作)
- · 把哪天纯数字化文本框的WEB控件代码贴出来。
- · 利用Repeater控件显示主-从关系数据表
- · 一个简单O/R M组件(HFSoft.Data).NET
- · 开发手记(九)——在文件菜单中记录最近使用过的文件
- · 开发手记(八)——ActiveBar控件中的利器(1)
- · 控件代码共享--日期选择控件
- · 功能增强的进度条控件(源码)
- · 改变 PropertyGrid 控件的编辑风格(4)——加入选择列表
- · 改变 PropertyGrid 控件的编辑风格(3)——打开对话框
- · 改变 PropertyGrid 控件的编辑风格(2)——编辑多行文本
