Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))

MyDocuments Property

Location

My.Computer.FileSystem.SpecialDirectories.MyDocuments

Syntax

Dim result As String = My.Computer.FileSystem. _ SpecialDirectories.MyDocuments

Description

The MyDocuments property returns the full path name to the "My Documents" folder for the current user on the local workstation. Usually, this directory is found at C:\Documents and Settings\user\My Documents, but it may vary from system to system.

Usage at a Glance

  • This property is read-only.

  • This folder contains user-specific files and directories.

  • This path may not be defined in some cases. In such cases, use of this property generates an exception.

  • The returned path will never have a backslash "\" character at the end.

  • The path used for "My Documents" varies between the different Windows operating systems. Windows Vista excludes the "My" prefix from the user-specific folder name, although the MyDocuments property will retain its current name.

Related Framework Entries

  • Microsoft.VisualBasic.MyServices.SpecialDirectoriesProxy.MyDocuments Property

  • Microsoft.VisualBasic.FileIO.SpecialDirectories.MyDocuments Property

See Also

AllUsersApplicationData Property, CurrentUserApplicationData Property, Desktop Property, MyMusic Property, MyPictures Property, ProgramFiles Property, Programs Property, SpecialDirectories Object, Temp Property

Категории