N
nicol
hi
i want to write some number in a file & than read second number( i
mean in just want to read one number from the file )i wrote a code for
it but it does not work i want second number but it writes for me the
first number
here is it codes
using System;
using System.IO;
class Program
{
static void Main(string[] args)
{
int a = 7, b = 2;
TextWriter write = new StreamWriter("data6.txt");
write.WriteLine(a);
write.WriteLine(b);
write.Close();
TextReader read = new StreamReader("data6.txt");
Console.WriteLine(read.ReadLine());
read.Close();
}
}
i want to write some number in a file & than read second number( i
mean in just want to read one number from the file )i wrote a code for
it but it does not work i want second number but it writes for me the
first number
here is it codes
using System;
using System.IO;
class Program
{
static void Main(string[] args)
{
int a = 7, b = 2;
TextWriter write = new StreamWriter("data6.txt");
write.WriteLine(a);
write.WriteLine(b);
write.Close();
TextReader read = new StreamReader("data6.txt");
Console.WriteLine(read.ReadLine());
read.Close();
}
}