How to get canonical file name by non-canonical one.
E.g. I want to call function which converts "C:\Program files\..\Windows\aaa.txt"
to "C:\Windows\aaa.txt"
I am looking for something like Java File.getCanonicalPath()
You can use the Path.GetFullPath
method for this.
Example:
Console.WriteLine(Path.GetFullPath(@"C:\Program files\..\Windows\aaa.txt"));
Output:
C:\Windows\aaa.txt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With