I am trying to use streamwriter to create a text file in the my documents folder, however it thinks i am using a relative path when i am actually using a full path.
I am trying to create the file using this path: “%HOMEPATH%/My Documents/”, but it treats this as a relative path.
Any help would be appreciated, thanks.
You should use
Environment.GetFolderPath– which in this case would avoid you hard-codingMy Documentsat all:If you wanted to get a directory name relative to that, you should use
Path.Combine: