For eg., I have a code in C#
a = 10
b = 10
c = a * b
I want to redirect the output c to a text file using c#. Can you please let me know how to do the same?
For eg., I have a code in C#
a = 10
b = 10
c = a * b
I want to redirect the output c to a text file using c#. Can you please let me know how to do the same?
Try StreamWriter:
var a = 10;
var b = 10;
var c = a * b;
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\test.txt");
file.WriteLine(c);
file.Close();