WP追加字符串到文件

#if DEBUG
                const string logfile = "demo.log";
                try
                {
                    using (var sw = new System.IO.StreamWriter(System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication().OpenFile(logfile, System.IO.FileMode.Append, System.IO.FileAccess.Write, System.IO.FileShare.Read)))
                    {
                        sw.WriteLine(string.Format("{0} [Demo] {1}", DateTime.Now, "a message"));
                    }
                }
                catch (Exception ex) { Debug.WriteLine("Save {0} ERROR!! {1}", logfile, ex); }
#endif
原文地址:https://www.cnblogs.com/Bob-wei/p/4517338.html