SpecialDirectories SpecialDirectories SpecialDirectories SpecialDirectories Class

Definition

Provides properties for accessing commonly referenced directories.

public ref class SpecialDirectories
public class SpecialDirectories
type SpecialDirectories = class
Public Class SpecialDirectories
Inheritance
SpecialDirectoriesSpecialDirectoriesSpecialDirectoriesSpecialDirectories

Examples

This example returns the filePath for the user's Desktop directory and displays it.

Dim filePath As String
filePath = My.Computer.FileSystem.SpecialDirectories.Desktop
MsgBox(filePath)

Remarks

If the path for the referenced directory is empty, usually due to the operating system not supporting the directory, a DirectoryNotFoundException exception is thrown.

No backslash (\) appears at the end of the path.

The following table lists examples of tasks involving the My.Computer.FileSystem.SpecialDirectories object.

To See
Read from the MyDocuments directory How to: Retrieve the Contents of the My Documents Directory

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library Yes
Windows Service Yes
Web Site Yes

Constructors

SpecialDirectories() SpecialDirectories() SpecialDirectories() SpecialDirectories()

Returns an instance of the SpecialDirectories class.

Properties

AllUsersApplicationData AllUsersApplicationData AllUsersApplicationData AllUsersApplicationData

Gets a path name pointing to the Application Data directory for the all users.

CurrentUserApplicationData CurrentUserApplicationData CurrentUserApplicationData CurrentUserApplicationData

Gets a path name pointing to the Application Data directory for the current user.

Desktop Desktop Desktop Desktop

Gets a path name pointing to the Desktop directory.

MyDocuments MyDocuments MyDocuments MyDocuments

Gets a path name pointing to the My Documents directory.

MyMusic MyMusic MyMusic MyMusic

Gets a path name pointing to the My Music directory.

MyPictures MyPictures MyPictures MyPictures

Gets a path name pointing to the My Pictures directory.

ProgramFiles ProgramFiles ProgramFiles ProgramFiles

Gets a path pointing to the Program Files directory.

Programs Programs Programs Programs

Gets a path name pointing to the Programs directory.

Temp Temp Temp Temp

Gets a path name pointing to the Temp directory.

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also