标签:style blog io color ar os sp for div
1 using System; 2 using System.IO; 3 using System.Text; 4 /// <summary> 5 /// 自定义Unity本地Debug 6 /// </summary> 7 public class MyDebug { 8 9 private static string path = @"C:/MyDebug.txt"; 10 public static void Log(string infor) 11 { 12 if (!File.Exists(path)) 13 { 14 File.Create(path); 15 } 16 FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write); 17 StreamWriter sw = new StreamWriter(fs); 18 sw.WriteLine(infor + " " + DateTime.Now); 19 sw.Close(); 20 sw.Dispose(); 21 fs.Close(); 22 fs.Dispose(); 23 } 24 }
记录信息存储在本地,方便查看
标签:style blog io color ar os sp for div
原文地址:http://www.cnblogs.com/Vincentblogs/p/4082239.html