I added a text file to my solution in VS2010 and called it test.txt.
In the properties of the file I have set copy to output : always and the build action : content.
How can I open this file in my project now? So that if a user presses a button it will open up the text file.
I have tried several methods, such as File.open("test.txt") and System.Diagnostics.Process.Start(file path)) and nothing has worked.
Can anyone offer up some suggestions?
Since you are using copy to output the file is being placed in the same directory as your program therefore you can use:
or based on this MSDN article: