Use JS to read the program of the configuration file with JS
D:/Useful Stuff/Javascript/MyTest.txt
The content of the file is as follows
Copy code code as follows:
[plugin_page_search]
Wholeword = 0
matchcase = 1
hightlight = 1
Total = 1
[DATA]
up = 85
don = 5
Copy code code as follows:
var FSO = New Activexobject ("Scripting.filesystemObject");
var F = FSO.OPENTEXTFILE ("D: // Useful Stuff // Javascript // MyTest.txt", 1); 1);
var s = "";
While (! F.atendofstream)
{{
s+= f.readline ();
}
f.Close ();
Function Getini (item, key)
{{
new regexp ("// ["+item+"//]"). exec (s);
var str = regexp. $ 1;
var reg2 =/(/w+) = (/d+)/;
var keyValue = {};
str.replace (reg2, function (a, b, c) {
Keyvalue [b] = c;
});
Return keyvalue [key];
}
Alert (getini ("data", "up");
Alert (Getini ("Plugin_page_search", "Hightlight");