Returns the absolute path for the specified path string.
Namespace: System.IOAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public static string GetFullPath(
string path
)
Parameters
- path
- Type: SystemString
The file or directory for which to obtain absolute path information.
Return Value
Type:
StringThe fully qualified location of
path, such as "C:\MyFile.txt".
Exceptions Exception | Condition |
---|
ArgumentException | path is a zero-length string, contains only white space, or contains one or more of the invalid characters defined in GetInvalidPathChars.-or- The system could not retrieve the absolute path. |
SecurityException | The caller does not have the required permissions. |
ArgumentNullException | path is null. |
NotSupportedException | path contains a colon (":") that is not part of a volume identifier (for example, "c:\"). |
PathTooLongException | The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. |
See Also