40

I have my custom application that generates a directory in My documents path, after installation the application uses that directory, but i got an issue in Chinese windows OS, where my application folder name appears in Chinese, so is there any way i can get the file name properly in "en" or some wordaround so that i can that directory name at runtime.

Vaibhav
  • 411
  • 1
  • 5
  • 6
  • What do you mean? If you create `MyApp` directory, it will show as `MyApp` regardless of locale. Maybe you have a bug in the code that creates the directory? – svick Oct 01 '11 at 15:31

2 Answers2

92

Use the special folders in System.Environment

var path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); var subFolderPath = Path.Combine(path, "sub folder");

Matthew Hazzard
  • 986
  • 5
  • 5
7
String path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

then you can append folder name as

string folder ="\\YOUR_FOLDER_NAME\\";

Then append to you path as

String full_path=path+folder;
Gourav Joshi
  • 2,419
  • 2
  • 27
  • 45
majana
  • 71
  • 1
  • 1
  • 2
    You should use `System.IO.Path.Combine()` to append two parts of a path. It takes care of the \, you don't have to put any. – Arkane Dec 04 '19 at 16:47