LogoWrite

public static void LogoWrite(string msg)
        {
            FileStream fs = null;
            StreamWriter sw = null;
            try
            {
                string FileName = string.Format(@"{1}\logo{0}.txt", DateTime.Now.ToString("yyyyMMddHH"), AppDomain.CurrentDomain.BaseDirectory.Trim());
                fs = new FileStream(FileName, FileMode.Append, FileAccess.Write, FileShare.Read);
                sw = new StreamWriter(fs, System.Text.Encoding.Default);
                sw.WriteLine(msg);
                sw.Flush();
            }
            finally
            {
                if (sw != null)
                {
                    sw.Close();
                    sw.Dispose();
                }
                if (fs != null)
                {
                    fs.Close();
                    fs.Dispose();
                }
            }
        }
posted @ 2009-06-03 15:20  94cool  阅读(156)  评论(0)    收藏  举报