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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
月光博客
月光博客
爱范儿
爱范儿
The Cloudflare Blog
Y
Y Combinator Blog
B
Blog RSS Feed
Stack Overflow Blog
Stack Overflow Blog
博客园 - 叶小钗
G
Google Developers Blog
J
Java Code Geeks
P
Proofpoint News Feed
美团技术团队
Engineering at Meta
Engineering at Meta
腾讯CDC
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园_首页
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
有赞技术团队
有赞技术团队
L
LangChain Blog
N
Netflix TechBlog - Medium
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】

博客园 - 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;
    }