I want to open file's location with window Explorer. I am using C# with code
System.Diagnostics.Process.Start("Explorer.exe", @"/select," + FilePath)
it works well with simple English character, but it could not open the file's location if the file's name is Unicode character (Thia language).
Anyone could help please?
Try putting it in quotes:
System.Diagnostics.Process.Start("Explorer.exe", @"/select,""" + FilePath + "\"")
No trouble with this code snippet:
static void Main(string[] args) {
string path = @"c:\temp\លួចស្រលាញ់សង្សារគេ.DAT";
System.IO.File.WriteAllText(path, "hello");
string txt = System.IO.File.ReadAllText(path);
}
Windows 7, the file is created and displays correctly in Explorer. You didn't document your operating system version so that's one failure mode, albeit a very small one. Much more likely is trouble with the file system that's mapped to your E: drive. Like a FAT32 volume on a flash drive or a network redirector. Ask questions about that, respectively, at superuser.com and serverfault.com. Do not forget to document those essential details.
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