我正在使用下面的一段代码,它在本地使用时工作得很好,但它可以用于服务器目的吗?有什么办法可以将OpenTextFile用于服务器目的?
function WriteToFile(data) {
var currentdate = new Date();
var datetime = "Time: " + currentdate.getDate() + "/" + (currentdate.getMonth()+1) + "/" + currentdate.getFullYear() + " @ " + currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds();
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.OpenTextFile("C:\\logs\\log.txt", 8);
a.WriteLine(datetime);
a.WriteLine(data + "\n");
a.Close();
}
我已经尝试了一切为我的Z:驱动器中的txt文件的路径,没有任何运气。这甚至有可能吗?我还授予对该文件夹“Everyone”的访问权限,以便它可以读写,但仍然无法打开txt文件进行编辑。对于我使用IE8的记录。
有什么建议吗?
读我的答案@ http://stackoverflow.com/questions/15537424/得到目录中的所有文件夹列表#15537569 – 2013-04-09 15:02:56
@IOIOMAD并没有真正回答我的问题 – randomizertech 2013-04-09 15:40:08