如何使用其路径VB.NET关闭打开的程序

编程入门 行业动态 更新时间:2024-10-28 15:34:35
本文介绍了如何使用其路径VB.NET关闭打开的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好,我想知道是否有人知道如何通过其路径关闭程序或文本文件(C:\ Users \ brandon \Documents\NewTextDoc(2))或(C:\ Users \\ \\ brandon \Documents\Hey.exe作为示例,任何人都可以帮助我。谢谢。 我尝试过: i真的没有尝试任何东西,我只是想尝试与程序一起玩,不知道从哪里开始这个有没有人知道我能做什么?

hello everyone i was wondering if anyone knew how i could close a program or textfile by its path so (C:\Users\brandon\Documents\NewTextDoc (2)) or (C:\Users\brandon\Documents\Hey.exe as an example can anyone help me out. Thanks. What I have tried: i havent really tried anything im just trying to have fun with programs and not sure where to start with this does anyone know what i could do?

推荐答案

你不能 - 你需要它来访问它。 想一想:如果我运行同一个程序的两个副本,你应该关闭哪一个? 您可以使用 Process.GetProcesses [ ^ ]获取所有当前正在运行的进程,然后 Process.Kill [ ^ ]以杀死特定进程。 每个Process对象都有可用于识别thr的属性你想要的: Process Class(System.Diagnostics) [ ^ ]包括ProcessName和MainWindowTitle You can't - you need it's Process to access it. Think about it: if I run two copies of the same program, which one should you close? You can use Process.GetProcesses[^] to get all the currently running processes, then Process.Kill[^] to kill a specific process. Each Process object has properties you may be able to use to identify thr one you want: Process Class (System.Diagnostics)[^] including the ProcessName and MainWindowTitle

更多推荐

如何使用其路径VB.NET关闭打开的程序

本文发布于:2023-11-03 11:59:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1555096.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何使用   路径   程序   VB   NET

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!