First of all, here is my C# code.
Now what i need is that everytime i run this program, the text "hey baby" should be written onto a.txt file.
But I do also need that there should be a serial number for each execution of the program just before the "hey baby".
Just like
1 hey baby
2 hey baby
3 hey baby
4 hey baby ...
I tried so hard, but i could not hit the target, any Happy Coders to help me out please !!
Code:
using System; using System.IO; class funny { static int i; public static void Main() { //File.Create(@"E:\a.txt"); //Console.WriteLine("file a.txt successfully created"); File.AppendAllText(@"E:\a.txt", ++i + " hey baby\r\n"); } }
But I do also need that there should be a serial number for each execution of the program just before the "hey baby".
Just like
1 hey baby
2 hey baby
3 hey baby
4 hey baby ...
I tried so hard, but i could not hit the target, any Happy Coders to help me out please !!
Comment