xxxxxxxxxx
using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8))
{
contents = streamReader.ReadToEnd();
}
xxxxxxxxxx
// To save the text as one string use 'ReadAllText()'
string text = System.IO.File.ReadAllText(@"C:\filepath\file.txt");
// To save each line seperately in an array use 'ReadAllLines()'
string[] lines = System.IO.File.ReadAllLines(@"C:\filepath\file.txt");
xxxxxxxxxx
string textFile = "C:\\data.txt";
string[] lines_raw = File.ReadAllLines(textFile);
// To get all lines and delete empty lines
string[] lines = File.ReadAllLines(videoListPath).Where(x => !string.IsNullOrWhiteSpace(x)).ToArray();
xxxxxxxxxx
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
xxxxxxxxxx
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
xxxxxxxxxx
sudo apt update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
xxxxxxxxxx
// To save the text as one string use 'ReadAllText()'
string fileContents = System.IO.File.ReadAllText(filePath);