我希望能够编辑和保存JavaScript中的文本文件,就像下面的代码一样,但我必须能够在不使用system.io的情况下执行此操作,因为这是一个Chrome应用程序。有什么办法可以做到这一点?在Chrome应用程序中使用Javascript访问文本文件
import System.IO;
var filePath = "data.txt";
function Start() {
if (!File.Exists(filePath)) {
CreateFile();
}
}
function CreateFile() {
var sw: StreamWriter = new StreamWriter(filePath);
sw.WriteLine("Hello World")
sw.Flush();
sw.Close();
print("Done");
}
有你看着https://github.com/GoogleChrome/chrome-app-samples/tree/master/samples/text-editor ? – mvermand
https://nodejs.org/api/fs.html你可以使用node.js fs – Grynets
不,我没有,但我现在就开始这样做,谢谢。 – LegusX