C#将代码中的信息保存为txt或ini文件

    这是我在使用坚石诚信的ET99产品时将信息写为ini文件的一段代码:

 

            FileStream fs = new FileStream("log.ini", FileMode.Append, FileAccess.Write);
            StreamWriter sw = new StreamWriter(fs);
            DateTime time = DateTime.Now;
            sw.WriteLine(time);
            sw.WriteLine("PID种子:" + strPIDseed);
            sw.WriteLine("SO PIN种子:" + strSOPINseed);
            sw.WriteLine("PID:" + strPID);
            sw.WriteLine("SO PIN:" + strSOPIN);
            sw.WriteLine("User PIN:" + strUserPIN); sw.WriteLine("*********************************");
            sw.Close();
            fs.Close();

posted @ 2010-11-19 17:31  Code技术人生  阅读(1572)  评论(0编辑  收藏  举报