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
VulpesPosted Jun 13, 2014, 7:19 AM
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?
Anupam SinghPosted Jun 13, 2014, 7:04 AM
This will create new file with the name you will specify in txtName.