User-1838255255 posted
Hi robby32,
According to your description, please use the following code to read file in root of the project.
AppDomain.CurrentDomain.BaseDirectory method will get the path of this project.
App_Data\Names.txt is the file folder and file name.
Path.Combine method will combine both of paths.
Code:
protected void Button1_Click(object sender, EventArgs e)
{
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"App_Data\Names.txt");
string[] files = File.ReadAllLines(path);
}
Result:

Best Regards,
Eric Du