Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
.NET Framework 3.5
System.IO Namespace
Path Class
 Path Members

  Switch on low bandwidth view
Members FilterMembers Filter
Frameworks FilterFrameworks Filter
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
.NET Framework Class Library
Path Members

Performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner.

The Path type exposes the following members.

  NameDescription
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkChangeExtension Changes the extension of a path string.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkCombine Combines two path strings.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetDirectoryName Returns the directory information for the specified path string.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetExtension Returns the extension of the specified path string.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetFileName Returns the file name and extension of the specified path string.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetFileNameWithoutExtension Returns the file name of the specified path string without the extension.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetFullPath Returns the absolute path for the specified path string.
Public methodStatic memberGetInvalidFileNameChars Gets an array containing the characters that are not allowed in file names.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetInvalidPathChars Gets an array containing the characters that are not allowed in path names.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkGetPathRoot Gets the root directory information of the specified path.
Public methodStatic memberGetRandomFileName Returns a random folder name or file name.
Public methodStatic memberSupported by the .NET Compact FrameworkGetTempFileName Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file.
Public methodStatic memberSupported by the .NET Compact FrameworkGetTempPath Returns the path of the current system's temporary folder.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkHasExtension Determines whether a path includes a file name extension.
Public methodStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkIsPathRooted Gets a value indicating whether the specified path string contains absolute or relative path information.
Top
  NameDescription
Public fieldStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkAltDirectorySeparatorChar Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkDirectorySeparatorChar Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization.
Public fieldStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkInvalidPathChars Obsolete. Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the Path class.
Public fieldStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkPathSeparator A platform-specific separator character used to separate path strings in environment variables.
Public fieldStatic memberSupported by the .NET Compact FrameworkSupported by the XNA FrameworkVolumeSeparatorChar Provides a platform-specific volume separator character.
Top
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
New Method Request: GetShortestRelativePath      Ron A Inbar   |   Edit   |   Show History
Syntax:

public static string GetShortestRelativePath(
string path,
string baseDirectory
)

Parameters:

path

A path (either rooted or relative to the current directory) to some file or directory.

baseDirectory

A path (either rooted or relative to the current directory) to some directory.

Return Value:

The shortest relative path from baseDirectory to path.

Exceptions:

ArgumentException

path is on a different volume than baseDirectory.


Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker