i want the text file created by this code to send to server by using mail as i provided email code in my CS file
i used following code but its not enough
using (StreamWriter sw = new StreamWriter(@"D:\text.txt"))
{sw.WriteLine("Name = " + txt_name.Text);
sw.WriteLine("Address = " + txt_ContctNo.Text);
}
using this it doesnt create new text file .manually u have to create it first

Anupam SinghRank #643 · 3.7K reputationPosted Jun 13, 2014, 3:04 AM EDT
This will create new file with the name you will specify in txtName.
VulpesRank #55 · 29.2K reputationPosted Jun 13, 2014, 3:19 AM EDT
It certainly should do unless the file already exists when it will be overwritten.
So, what happens if you do try to create a new file - do you get an exception or does nothing happen at all?