C# Path GetFullPath
Description
Path GetFullPath
Returns the absolute path for the specified
path string.
Syntax
Path.GetFullPath
has the following syntax.
public static string GetFullPath(
string path
)
Parameters
Path.GetFullPath
has the following parameters.
path
- The file or directory for which to obtain absolute path information.
Returns
Path.GetFullPath
method returns The fully qualified location of path, such as "C:\MyFile.txt".
Example
The following code example demonstrates the GetFullPath method.
/*from w w w .j a va 2 s. c om*/
using System;
using System.IO;
public class MainClass
{
public static void Main(String[] argv)
{
string path1 = @"mydir";
string fullPath = Path.GetFullPath(path1);
Console.WriteLine(path1);
}
}
The code above generates the following result.