调试跟踪
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);
}
}
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);
}
}
浙公网安备 33010602011771号