Sai Yang

Sai Yang

  • NA
  • 136
  • 27.7k

C#. Readalltext from bin folder

Mar 22 2018 2:39 AM
I need to load my file.txt from the bin folder in the same project. The file contains a code for C# language. I I need to readalltext as a code, not for to open the file like in VB it uses like bellow but in C# I can not read it.
 
VB.net: conn.ConnectionString = My.Computer.FileSystem.ReadAllText("Connection.txt")
 
this code use for a connection string in VB.net.
 
In my case, I need to read like that but not for a connection. It is for a function in form code editor.
 
 Any solution relates???
 
thank you. 

Answers (2)