Majid Rahimi Majid Rahimi - 4 months ago 14
C# Question

What is default directory of File.Open?

I have this code:

Stream f = File.Open("data.majid", FileMode.OpenOrCreate, FileAccess.ReadWrite);


Where will be file created?

Answer

From the File.Open MSDN documentation:

The path parameter is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory. To obtain the current working directory, see GetCurrentDirectory.