用于查找输入路径是否为系统特殊文件夹路径的任何C#API。 [英] Any C# API to find whether an input path is a system special folder path.

查看:111
本文介绍了用于查找输入路径是否为系统特殊文件夹路径的任何C#API。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

Hello All,

请告诉我C#(。Net Framework)中是否有可用的API,可以检查输入路径是指向还是包含系统特殊文件夹路径如"C:\ Windows","C:\ ProgramData"或"C:\ Windows \ System32"等,并返回相应的布尔值
值。

Kindly let me know if there is any API available in C#(.Net Framework) that can check whether the input path points to or contains system special folders path like 'C:\Windows','C:\ProgramData' or 'C:\Windows\System32' etc. and return a corresponding boolean value.

我可以使用C#的Environment.GetFolderPath(Environment.SpecialFolder)API。但我观察到,在某些Windows 10 PC中,此API在其他一些Windows 10 PC中返回"C:\ Windows"和"C:\ WINDOWS"。因此,我必须明确地对输入路径的输出
进行区分大小写的比较。我想避免这些额外的代码工作进行比较。

I can use Environment.GetFolderPath(Environment.SpecialFolder) API of C#. But I observed that, in some Windows 10 PCs this API returns 'C:\Windows' and 'C:\WINDOWS' in some other Windows 10 PCs. So, I have to perform a case-sensitive comparison of output of this API with the input path explicitly. And I want to avoid this extra code work for comparison.

谢谢,

Abhilash

推荐答案

查看
这个
可以帮助你


这篇关于用于查找输入路径是否为系统特殊文件夹路径的任何C#API。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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