So, I have been working on a project, an educational software, something like that. I used a lot of text, images, videos and so on. It's for a contest. My biggest concern came when I found out that if I try to open the app on another PC,it will crah because of the texts that are imported from .txt files located on my PC.
After searching for a little, I found out, if a place the .txt file inside my project, it would solve the problem and I could read it very simple with the second command provided. But it was a mess. I had over 50+ .txt files. Imagine what mess it would have been if I had put all my .txt files inside the project. By putting a .txt file inside the project I mean right-click project name->Add->Existing file. I created a folder inside the project and put all the .txt files inside in it, but the second command it won't work anymore.
Is there a way to acces all the .txt files from a folder within the project, or a way to make the app portbable, no matter what is the .txt file paths. ?
Note: This is a text project, where I used only one .txt file for a test, but the same problems I encountered.
First command I used:
StreamReader read = new StreamReader(@"DC.txt");
And the Second command I used:
StreamReader read = new StreamReader(@"C:\Users\Cristi\Desktop\DC.txt");