调试跟踪

 string path="D:\\log.txt";
                if (!File.Exists(path))
                {
                    using (System.IO.StreamWriter sw = File.CreateText(path))
                    {
                        sw.WriteLine(url.ToLower());
                    }
                }
                else
                {
                    using (System.IO.StreamWriter sw = File.AppendText(path))
                    {
                        if ((File.GetAttributes(path) & System.IO.FileAttributes.ReadOnly) == System.IO.FileAttributes.ReadOnly)
                            File.SetAttributes(path, System.IO.FileAttributes.Normal);
                        sw.WriteLine(_message);
                    }
                }
posted on 2009-09-25 16:39  西湖浪子  阅读(120)  评论(0)    收藏  举报