void SaveText()
{
StreamWriter sw;
FileInfo t =
new FileInfo(Application.persistentDataPath +
"//" +
"FileName.txt");
if (!t.Exists)
{
sw = t.CreateText();
}
else
{
sw = t.AppendText();
}
sw.WriteLine(
"hai tao gao ruan");
sw.Close();
sw.Dispose();
}
ArrayList quChuNeiRong()
{
StreamReader sr =
null;
try
{
sr = File.OpenText(Application.persistentDataPath +
"//" +
"FileName.txt");
}
catch (Exception e)
{
return null;
}
string line;
ArrayList arrlist =
new ArrayList();
while ((line = sr.ReadLine()) !=
null)
{
arrlist.Add(line);
}
sr.Close();
sr.Dispose();
return arrlist;
}
打开手机,查看本地会发现如下文件:
FR:海涛高软(hunk Xu)