DesktopDirectory之间的区别

DesktopDirectory之间的区别

本文介绍了什么是SpecialFolder.Desktop和SpecialFolder.DesktopDirectory之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于什么是SpecialFolder.Desktop和SpecialFolder.DesktopDirectory之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 00:09