C #: How to use a text file that is added to My project From 'add new items \ general'

Hi, I recently used Visual Studio 2008. My problem is that I have already added a text file to my project ['' add new items \ general \ Text File '']. [This is not embedded data, such as an icon file or a background file?] I want to store some data in it. But I don’t know how to open this file. Please, any opinion will be very helpful. Thank.

+3
source share
1 answer

Put the file in some place (for example, relative to .EXE) that you can recover at runtime and open it.

Another approach is to add it to your resources.

, , Application.UserAppDataPath.


" | | ".
" " . ( TextFile1), #.

 string s = Properties.Resources.TextFile1;
+4

Source: https://habr.com/ru/post/1758519/


All Articles