C# txt文档操作

            string path = AppDomain.CurrentDomain.BaseDirectory + "operalog.txt";
            if (!System.IO.File.Exists(path))
            {
                FileStream stream = System.IO.File.Create(path);
                stream.Close();
                stream.Dispose();
            }
            using (StreamWriter writer = new StreamWriter(path, true))
            {
                writer.WriteLine(CCNO);
                writer.WriteLine(CCtype);
                writer.WriteLine(Status);
                writer.WriteLine(clsPageCond.limit);
                writer.WriteLine(clsPageCond.Page);
            }

猜你喜欢

转载自blog.csdn.net/Javon_huang/article/details/80526637