什么是SpecialFolder.Desktop和SpecialFolder.DesktopDirectory之间的区别?区别、SpecialFolder、Desktop、DesktopDirecto

由网友(回忆渗出苦涩)分享简介:我很困惑这两个特殊文件夹之间的差异。I'm confused about the differences between these two special folders.下面是写入每个输出code段,但它们的输出是一样的。 Here's a code snippet that writes the outpu...

我很困惑这两个特殊文件夹之间的差异。

I'm confused about the differences between these two special folders.

下面是写入每个输出code段,但它们的输出是一样的。

Here's a code snippet that writes the output of each, but they output the same thing.

string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
string pathTwo = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);

Console.WriteLine(path);
Console.WriteLine(pathTwo);

Console.ReadKey();

根据MSDN文件(用于.NET 1.1 的):

桌面 逻辑桌面,而不是物理文件系统位置。

Desktop The logical Desktop rather than the physical file system location.

DesktopDirectory 该目录用于在桌面上物理存储文件的对象。不要与桌面文件夹本身,它是一个虚拟文件夹混淆目录。

DesktopDirectory The directory used to physically store file objects on the desktop. Do not confuse this directory with the desktop folder itself, which is a virtual folder.

这是什么意思时,它说逻辑桌面,而不是物理文件系统位置?此外,什么是简单来说一个虚拟文件夹

What does it mean when it says the logical Desktop rather than the physical file system location? Also, what is a virtual folder in simple terms?

在新的.NET 4的版本的documentation,我注意到,他们删除了桌面完全与只剩 DesktopDirectory 。 这是为什么?

In the newer .NET 4 version of the documentation, I noticed that they removed the Desktop entirely and only left DesktopDirectory. Why is this?

推荐答案

目录是在文件系统中的位置。文件夹是在外壳命名空间中的位置。目录是一种文件夹中。虚拟文件夹并不一定是由一个目录下备份。例如,考虑库或搜索文件夹。

A directory is a location in the file system. A folder is a location in the shell namespace. A directory is a kind of folder. A virtual folder is not necessarily backed by a directory. For example consider libraries or search folders.

用户的桌面目录是在文件系统中的位置。桌面文件夹合并与虚拟物品,如所有用户的项目,回收站,快捷方式的文件夹等。

The user's desktop directory is a location in the file system. The desktop folder merges that with virtual items like all users items, recycle bin, shortcut to documents folder etc.

阅读全文

相关推荐

最新文章