How to get the name of a canonical file non-canonical.
eg. I want to call a function that converts "C:\Program files\..\Windows\aaa.txt" to "C:\Windows\aaa.txt"
"C:\Program files\..\Windows\aaa.txt"
"C:\Windows\aaa.txt"
I am looking for something like Java File.getCanonicalPath ()
You can use the Path.GetFullPath method for this.
Path.GetFullPath
Example:
Console.WriteLine(Path.GetFullPath(@"C:\Program files\..\Windows\aaa.txt"));
Conclusion:
C: \ Windows \ aaa.txt
System.IO.Path.GetFullPath("C:/Program files/../Windows/aaa.txt")
will return
"C:\\Windows\\aaa.txt"
Here is my suggestion:
string path = Path.GetFullPath(@"C:\Program files\..\Windows\aaa.txt");
Source: https://habr.com/ru/post/901286/More articles:preg_replace to delete offline numbers - phpHow to write a valid Decorator class in Python? - scopeConvert path to polygon - pythonHow to change the logo displayed in the browser title bar for a web application deployed to tomcat? - web-applicationsUsing column format in spec and blue book - openglAndroid Best Practice - Views / Actions - javaHow to select a radio button using Mechanize in Ruby? - ruby | fooobar.comMFMailComposeViewController can send a notification of a change in sending, if not returned - iosSmarty: check if a variable is in an array - arraysHide all rows of a table after a specific number? - jqueryAll Articles