-dt-
Scripting Contest Winner
;o
Posts: 1819 Reputation: 74
36 / /
Joined: Mar 2004
|
RE: [Help] Save strings
quote: Originally posted by Huhu_Manix
Oooh you want to read the file too...it's not important ! ^^'
Take this but i think there's better function than this :
code: function read(file) {
var FileSystem= new ActiveXObject('Scripting.FileSystemObject');
var file = FileSystem.OpenTextFile(file, 1);
lines = "";
while(!file.AtEndOfStream) {
lines += file.ReadLine()+"\n";
}
file.Close();
return lines ;
}
code: function readFile(file, isUnicode){
var fileStream = new ActiveXObject('Scripting.FileSystemObject').GetFile(file).OpenAsTextStream(1,((typeof(isUnicode) != "undefined" && isUnicode) ? -1 : 0));
var data = fileStream.ReadAll();
fileStream.Close();
return data;
}
This post was edited on 08-04-2006 at 03:16 PM by -dt-.
Happy Birthday, WDZ
|
|