CS_0015_Copy the values from Text file
// Program 15 : Copy the values from a text file
( from separate item tab)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO; // for StreamReader
namespace ConsoleApplication9
{
class Program
{
static
void
Main(string[] args)
{
StreamReader
myReader = new StreamReader("myTextValues.txt");
// myTextValues are added in a New Item
// Change the properties of the item as ' copy if
newer'
string
line = "";
while
(line != null)
{
line =
myReader.ReadLine(); // Read line by
linefrom the myTextValues.txt
if (line != null)
Console.WriteLine(line);
}
myReader.Close(); // close the myReader if there is a null value
Console.ReadLine();
}
}
}
Comments
Post a Comment