Backup

        /*
        private void writeLog()
        {
            string t = DateTime.Now.ToString("yyyyMMdd");
            if (File.Exists(CurrentPath + "\\log\\" + t + ".txt"))
            {
                StreamWriter nw = new StreamWriter(CurrentPath + "\\log\\" + t + ".txt", true, System.Text.Encoding.UTF8);
                for (int i = 0; i < listBox2.Items.Count; i++)
                {
                    nw.WriteLine(listBox2.Items[i]);
                }
                nw.Close();
            }
            else
            {
                StreamWriter sw = new StreamWriter(CurrentPath + "\\log\\" + t + ".txt", false, System.Text.Encoding.UTF8);
                for (int i = 0; i < listBox2.Items.Count; i++)
                {
                    sw.WriteLine(listBox2.Items[i]);
                }
                sw.Close();
            }
        }
        */

 

posted @ 2013-07-22 14:47  Ethan.Sun  阅读(264)  评论(1编辑  收藏  举报