沙盒路径
Asset根目录路径: Application.dataPath +”xxx”;
写入操作 StreamWrite –sw.Write() 写入文档
读入操作 StreamReader – sr.ReadToEnd() 读入文档
创建文件,写内容
public void CreateAndWrite(){
string path = Application.dataPath + "/Resources/Q.txt";
FileStream fs = null;
if (!File.Exists (path)) {
fs = File.Create (path);
} else {
fs = File.Open (path, FileMode.Open);
}
StreamWriter sw = new StreamWriter (fs);
string content =