Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData Property

Gets a path for storing application data that is shared among all users on the computer.

' Usage
Dim value As String = My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData
' Declaration
Public ReadOnly Property AllUsersApplicationData As String

The following condition may cause an exception:

The My.Computer.FileSystem.SpecialDirectories Object contains paths to commonly referenced directories.

If the path does not exist, it is created with the following format: BasePath\CompanyName\ProductName\Version

A typical BasePath in Windows XP is C:\Documents and Settings\All Users\Application Data. The CompanyName, ProductName, and Version can be obtained from the My.Application.Info.CompanyName, My.Application.Info.ProductName, and My.Application.Info.Version properties.

NoteNote:

If the Company and Product names are not specified in the Assembly Information dialog box, the CompanyName\ProductName in the path are replaced with the assembly name. For more information on setting assembly information names, see How to: Specify Assembly Information (Visual Basic, C#).

This example displays the path for shared application data in a MessageBox.

MsgBox _
(My.Computer.FileSystem.SpecialDirectories.AllUsersApplicationData)

Namespace: Microsoft.VisualBasic.MyServices

Class: SpecialDirectoriesProxy (provides access to SpecialDirectories)

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

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

The following permission may be necessary:

Permission

Description

FileIOPermission

Controls the ability to access files and folders. Associated enumeration: Unrestricted.

For more information, see Code Access Security and Requesting Permissions.

Community Additions

ADD
Show:
© 2015 Microsoft