SurajSing SurajSing - 3 years ago 99
C# Question

Read file from root directory folder using filestream

There are two Image files in my folder which I have to call in my program. I have used:

AppDomain.curentDomain.baseDirectory + "Path and file name";

But this goes into my bin directory which I don't want; I want to read the folder from root directory where my folder name as resource I have saved my file there and call the image so please what's the code for that?

How do I read from root directory in a Windows Form Application?

Answer Source

Usually, you have to set those items to be copied into the bin folder. Right click in solution explorer/navigator, choose properties and set "Copy to output directory". hope this will work

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download