在C#应用程序中关闭C驱动器(c:\\) [英] Closing c drive (c:\\) in C# application

查看:77
本文介绍了在C#应用程序中关闭C驱动器(c:\\)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

foreach (var proc in Process.GetProcessesByName("*.exe"))
            {
                proc.Kill();
            }

伙计们,通常我们使用kill进程退出* .exe应用程序,但是现在我的问题是,如何关闭c驱动器(c:\)/open目录?我想使用C#应用程序关闭C驱动器(c:\)/open目录吗?

Guys, Normally we use kill process to exit *.exe application, but now my question is, how to close c drive (c:\)/open directory? I want it using C# application to close c drive (c:\)/open directory?

Loginthiren

Loginthiren

推荐答案

我不明白:"C:\ drive"不是一个过程;它是一个目录.

I do not understand: The "C:\ drive" is not a process; it is a directory.

您是说要关闭其中正在打开某些文件的特定应用程序吗?可能是因为c:\驱动器显然是顶层文件夹.

Do you mean you want to close a particular application that is holding open some files within it? Which could be anything because the c:\ drive is obviously the top level folder.

您的代码段将尝试杀死每个正在运行的应用程序,包括使系统保持运行状态的所有应用程序,因此听起来很危险!

Your code snippet will try to kill every running application, including all the ones keeping your system running, so this is all sounding rather dangerous!


这篇关于在C#应用程序中关闭C驱动器(c:\\)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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