日期:2014-05-18 浏览次数:20858 次
private void SaveToFile() { string result = this.Barcode1 + "," + this.Barcode2 + "," + this.SNoCount + "," + this.TimeStamp; }
System.IO.StreamWriter sw = new System.IO.StreamWriter(@"C:\logfile.txt",true); sw.WriteLine(result); sw.Close();
------解决方案--------------------
System.IO.StreamWriter sw = new System.IO.StreamWriter(@"C:\logfile.txt",true);
sw.WriteLine(result);
sw.Flush();
sw.Close();
or
File.WriteAllText("c:\text.txt",text);
------解决方案--------------------