How can i do re coding without assign null value?
- by Phsika
How can i do below without assign null value "Tex=null"?
static void Main(string[] args)
{
FileInfo f = new FileInfo("C:/temp/Arungg.txt");
StreamWriter Tex;
Tex = null;
if (!f.Exists)
{
f.CreateText();
}
else
{
Tex = f.AppendText();
}
Tex.WriteLine("Test1");
Tex.WriteLine("Test2");
Tex.Write(Tex.NewLine);
Tex.Close();
Console.WriteLine(" The Text file named Arungg is created ");
}