Skip to content

Instantly share code, notes, and snippets.

@FlameWert
Last active February 6, 2020 23:47
Show Gist options
  • Save FlameWert/7c4c7110cc462edee9f4148008f96351 to your computer and use it in GitHub Desktop.
Save FlameWert/7c4c7110cc462edee9f4148008f96351 to your computer and use it in GitHub Desktop.
Read a text file inside a folder in a Visual Studio Project: C#
using System;
using System.IO;
class Program
{
public static void Main(string[] args)
{
//Traverse two folders up
string path = "../../Queries/Stage_Organization.sql"; //sql file is also a text file
string query = File.ReadAllText(path);
print(query);
}
}
@FlameWert
Copy link
Author

Forgot to include main function. I just added it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment