string strPath = Server.MapPath("/") + "log.txt";
StreamWriter sw = File.AppendText(strPath);
//开始写入
sw.WriteLine(" 当前时间:"+DateTime.Now.ToString());
//清理当前编码器的缓冲区,并将所有缓存数据写入基础流
sw.Flush();
sw.Close();
StreamWriter sw =new StreamWriter(@“C:\\123.txt”,FileOpen.OpenOrCreate,FileAccess.ReadAndWrite);
//开始写入
sw.WriteLine(" 当前时间:"+DateTime.Now.ToString());
//清理当前编码器的缓冲区,并将所有缓存数据写入基础流
sw.Flush();
sw.Close();
不好使找我!!!
getdate()