本文介绍了在c#中以编程方式查找Windows文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在编写一个程序来杀死并重新启动资源管理器,但我不想硬编码该位置,因为有些人在不同的地方安装Windows(例如我发现有人在d:\驱动器中安装了C:\驱动器确实存在但没有安装它)
我试过在Environment.SpecialFolder下查找。但是我没有看到
的最佳方式是什么?
解决方案msdn.microsoft / en-us / library / 77zkk0b6.aspx
尝试这些:
Environment.GetEnvironmentVariable(SystemRoot) Environment.GetEnvironmentVariable(windir)
I am writing a program to kill and restart explorer but I don't want to hard code the location because some people install windows in different places (for example I found someone who had it installed in the d:\ drive where the C:\ drive did exist but had nothing installed on it)
I tried looking under Environment.SpecialFolder. but I don't see a "windows" option under that
What is the best way to do this?
解决方案msdn.microsoft/en-us/library/77zkk0b6.aspx
Try these:
Environment.GetEnvironmentVariable("SystemRoot") Environment.GetEnvironmentVariable("windir")
更多推荐
在c#中以编程方式查找Windows文件夹
发布评论