📄 file.js
字号:
// Description: js.io.File 类
// Author: Changhua.Wan
// Version: 2004.03.06.01
_package("js.io");
_import("js.lang.Object");
function js.io.File(_path) {
this.path = null;
this.data = null;
if (typeof(_path) == "string") this.path = _path;
this.getFileName = function() {
if (this.path == null) return null;
var idx = this.path.lastIndexOf("\\");
return this.path.substring(idx + 1);
};
this.getData = function() {
if (this.path == null) return null;
if (this.data == null) {
try {
this.data = Class.forName("js.io.FileReader").readBinary(this.path);
} catch(ex) {
ex.printStackTrace();
}
}
return this.data;
};
this.saveAs = function(_path) {
try {
Class.forName("js.io.FileWriter").writeBinary(_path, this.getData());
this.path = _path;
} catch(ex) {
ex.printStackTrace();
}
};
this.size = function() {
if (typeof(vbs_lenb) == "undefined")
execScript("Function vbs_lenb(d) \n vbs_lenb = LenB(d) \n End Function","VBScript");
return vbs_lenb(this.getData());
}
}
js.io.File._extends("js.lang.Object");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -