using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using LitJson;
namespace CShapeTest
{
class Start
{
static void Main(string[] args)
{
// 文件读取类
// File.ReadAllLines类
//string[] strArray = File.ReadAllLines("Skill.json");
//foreach (var item in strArray)
//{
// Console.WriteLine("File.ReadAllLines:" + item);
//}
// File.ReadAllText类
//string str = File.ReadAllText("Skill.json");
//Console.WriteLine("File.ReadAllText:" + str);
// File.ReadAllBytes类
//byte[] bytes = File.ReadAllBytes("Skill.json");
//foreach (var item in bytes)
//{
// Console.WriteLine(item);
//}
// 文件写入类
// File.WriteAllLines类
//File.WriteAllLines("Skill_1.json", new string[] {"cxm1", "cxm2", "cxm3"});
// File.WriteAllText类
//File.WriteAllText("Skill_1.json", "Hello world");
File.WriteAllBytes("Skill_1.json", new byte[] {0x01, 0x02, 0x03});
Console.ReadLine();
}
}
}
C#_File文件读取和写入
最新推荐文章于 2024-07-09 19:31:55 发布