- main()
- function main()
- {
- var tmp_file = new File(Folder.desktop+ "/" + "~tmp.psd");
- var s = "";
- if (!tmp_file.open("r")) { throw("tmp file open error"); }
- tmp_file.encoding = "BINARY";
- tmp_file.seek(1, 0); //从开始偏移1位
- s = tmp_file.read(1); // 读取一位 =B
- alert(s)
- var x= s.charCodeAt(0); // 获得第0位的字符=B
- alert(x)
- s = tmp_file.read(4); // 读取4位=PS..
- alert(s)
- var x= s.charCodeAt(1);// 获得第1位的字符 =S
- alert(x)
- tmp_file.close();
- }