使用VB.NET运行和退出程序 [英] Run and exit programs using VB.NET

查看:974
本文介绍了使用VB.NET运行和退出程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想编写一个程序来检查另一个程序(Microsft字或任何程序)是否正在运行
如果未运行,则主程序将朗读第二个程序.

解决方案

查找正在运行的应用程序:

Dim processlist As Process() = Process.GetProcesses()
For Each p As Process In processlist
	Console.WriteLine("Process: {0} ID: {1}", p.ProcessName, p.Id)
Next

然后您可以使用

Hi all,
I want to write a program which will check if another program(Microsft word or any program ) is running or not
if it is not running the main program will rum the second one.

To find which applications are running:

Dim processlist As Process() = Process.GetProcesses()
For Each p As Process In processlist
	Console.WriteLine("Process: {0} ID: {1}", p.ProcessName, p.Id)
Next

You can then start the applciation using Process.Start[^]


这篇关于使用VB.NET运行和退出程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆