I have this code:
Stream f = File.Open("data.majid", FileMode.OpenOrCreate, FileAccess.ReadWrite);
Where will be file created?
I have this code:
Stream f = File.Open("data.majid", FileMode.OpenOrCreate, FileAccess.ReadWrite);
Where will be file created?
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.
Usually the directory where the process was started from. This is the current working directory.
From MSDN
The current directory is distinct from the original directory, which is the one from which the process was started.
From MSDN
;
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.
Check out Directory.GetCurrentDirectory
The current directory is distinct from the original directory, which is the one from which the process was started.
it will store in current directory . that your application will run
e.g :
if you call Directory.GetCurrentDirectory();
it will return :
"C:\Program Files\Common Files\Microsoft Shared\DevServer\10.0"
Additionally:
the working directory can be changed in VisualStudio project settings Project | Properties | Debug
if you create a shortcut to the application for a user you can specify the "Start in" property
© 2022 - 2024 — McMap. All rights reserved.