Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 4
System
 Environment.SpecialFolderOption Enu...
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2010/.NET Framework 4

Other versions are also available for the following:
.NET Framework Class Library
Environment..::.SpecialFolderOption Enumeration

Updated: October 2010

Specifies options to use for getting the path to a special folder.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)
Visual Basic
Public Enumeration SpecialFolderOption
C#
public enum SpecialFolderOption
Visual C++
public enum class SpecialFolderOption
F#
type SpecialFolderOption
Member nameDescription
NoneThe path to the folder is verified. If the folder exists, the path is returned. If the folder does not exist, an empty string is returned. This is the default behavior.
CreateThe path to the folder is created if it does not already exist.
DoNotVerifyThe path to the folder is returned without verifying whether the path exists. If the folder is located on a network, specifying this option can reduce lag time.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Reference

Date

History

Reason

October 2010

Corrected descriptions of values.

Customer feedback.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
XML Comments inside of Visual Studio are still incorrect      J_Mackay   |   Edit   |   Show History
I noticed the inconsistencies inside of visual studio when looking at this enum, they are still using the incorrect descriptions stated above.
Tags What's this?: Add a tag
Flag as ContentBug
Are the descriptions correct?      rbrongers   |   Edit   |   Show History
It seems to me that the descriptions are not matching the values. Why does None NOT VERIFY the path, while DoNotVerify creates and Create verifies (and is the default behavior).
Shouldn't the order of the values be the following?

DoNotVerify
Returns the path, but does not verify whether the path exists. If the folder is located on a network, specifying this option can reduce lag time.

None
Verifies the folder path. If the folder does not exist, an empty string is returned. This is the default behavior.

Create
Forces the folder to be created if it does not already exist.

That would make more sense to me. Either that or I don't understand the options completely.
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker