using FileDlg;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;public class shezhidaxiao : MonoBehaviour
{
void WriteTXT()
{
StreamWriter sw;
FileInfo fi = new FileInfo(Application.streamingAssetsPath + "//" + name+"gggggggggggggg");
if (!fi.Exists)
{
Debug.Log("写入 不存在");
Debug.Log(fi .Name );
sw = fi.CreateText();
//sw.WriteLine ("this is a line.");
}
else
{
Debug.Log("写入 存在");
sw = fi.CreateText();
}sw.Write(shuru.text);
sw.Close();
sw.Dispose();
}
void ReadTXT()
{FileInfo fi = new FileInfo(Application.streamingAssetsPath + "//" + name+"gggggggggggggg");
if (!fi.Exists)
{
Debug.Log("读取 不存在");
//sr = fi.AppendText()
//sw.WriteLine ("this is a line.");
}
else
{
Debug.Log("读取 存在");
StreamReader sr = new StreamReader(Application.streamingAssetsPath + "//" + name + "gggggggggggggg");
string s;
s = sr.ReadLine();
Debug.Log(s);
string s2;
s2 = s.Split(',')[0];
Debug.Log(s2);
Debug.Log("长度为" + s.Split(',').GetLength(0));}
}
}