将字符串写入记事本
string jsonStr = JsonConvert.SerializeObject(data); FileStream stream = new FileStream(@"C:\Users\YeChangZhong\Desktop\新建文件夹\aa.txt", FileMode.Create);//fileMode指定是读取还是写入 StreamWriter writer = new StreamWriter(stream); writer.WriteLine("===================="); writer.WriteLine(jsonStr); writer.WriteLine(data.CREATEUSERNAME); writer.WriteLine(data.MODIFYUSERNAME); writer.WriteLine("===================="); writer.Close();//释放内存 stream.Close();//释放内存