Text File not Creating! =(
Hey there!, i'm using a simple method for creating a text file and writing on it, i'm doing this in two places of my application, and they are the same!! but one works and the other just does anything!!... and its being called! Here is the method:
public void createLog(){
String file = "somefile.txt";
StreamWriter log = File.CreateText(file);
log.WriteLine("Log File for Go and Connect Emailer");
log.WriteLine("");
log.WriteLine("Date: " + DateTime.Today.ToString());
log.WriteLine("Time: " + DateTime.Now);
log.WriteLine("");
log.WriteLine("Emails not sent to the following address: ");
log.WriteLine(emailsNotSent);
log.WriteLine("");
log.WriteLine("Total emails not sent : " + errors);
log.WriteLine("Total emails sent : " + sentOk);
sentOk += errors;
log.WriteLine("Total emails : " + sentOk);
log.Close();
}
|