惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Jina AI
Jina AI
WordPress大学
WordPress大学
Recent Announcements
Recent Announcements
G
Google Developers Blog
I
InfoQ
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
MyScale Blog
MyScale Blog
M
MIT News - Artificial intelligence
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
Check Point Blog
J
Java Code Geeks
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
量子位
A
About on SuperTechFans
D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

博客园 - UnseenstoneX

《打砖块创作家》隐私政策 打砖块创作家《小游戏隐私保护指引》 python 常用数据结构 Python 基本语法 地形遇到几个问题 TArray数组 UE问题分部解决 UE寻找Actor UE对话框 ShadowCaster 代码 C#读写csv文件 优化相关 unity 打开文件夹并鼠标选中某文件 Json解析 C# winform中 选择文件和保存文件 Unity与Android交互实现 一个将数据均匀分段1,2,5的随写 C# 持续序列化对象追加到文件的方法 C#二进制序列化和反序列化
读写文件
UnseenstoneX · 2018-06-06 · via 博客园 - UnseenstoneX
 void WriteFiles()
    {
       // StreamWriter sw = new StreamWriter("D://result.txt");

        FileInfo myFile = new FileInfo(@"D://result.txt");
        StreamWriter sw = myFile.CreateText();
        for (int i = 0; i < nameList.Count; i++)
        {
            sw.WriteLine(nameList[i]);
            Debug.Log("写入"+nameList[i]);
        }
        sw.Close();
    }

    List<string> ReadFiles()
    {
        List<string> list = new List<string>();
        StreamReader sr = File.OpenText(@"D://result.txt");
        string nextLine;
        while ((nextLine = sr.ReadLine()) != null)
        {
            // Console.WriteLine(nextLine);
            Debug.Log("读取"+nextLine);
            list.Add(nextLine);
        }
        sr.Close();
        return list;
    }