FSO的强大功能

2019-01-14 07:01:19于海丽

<button onclick="vbs:seachFile" id="searchButton">查找</button><br/>
<div id="seachList" style='margin-left:0' >搜索结果</div>
</div>
</div>
<input type="button" id="hide_control" onmousedown="vbs:beginDrag" onmouseup="vbs:upHandler" bgcolor="#eeeeee"/>
<div valign="top" id="txtFrm">
标题:<input id="articleTitle" style="width:100" readonly/>
<button id="browse" onclick="vbs:browseMe" >预览</button>
<button id="saveButton" onclick="vbs:saveFile" >保存</button>
<button id="browse" onclick="vbs:createFile" >新建</button>
<button id="test" onclick="vbs:showHelp">说明</button>
行 <span id="Ln">1</span>
<textarea id="txt" onkeydown='vbs:TabTxt' onclick="vbs:showLn"></textarea>
</div>


<SCRIPT LANGUAGE="vbscript">
'**************************
'*****超级大笨狼***********
'**************************
on error resume next
window.resizeTo window.screen.availWidth,window.screen.availHeight
window.moveTo 0,0

Set fso = CreateObject("Scripting.FileSystemObject")
dim thisFileDir'定义本文件绝对路径
dim thisFileName'定义本文件名
dim thisFileFolder'定义本文件夹路径


thisFileDir = replace(window.location.href,"file:///","")
thisFileDir = unescape(replace(thisFileDir,"/",""))
thisFileName = LastOne(thisFileDir,"")
thisFileFolder=getFolderDir(thisFileDir)
tree.title = thisFileFolder

dim currentDir'当前路径
dim currentFile'当前文件
dim currentDiv'当前DIV对象
dim currentSpan'当前Span对象
dim delatX
dim dragAble:dragAble = false


currentDir = thisFileFolder
set currentDiv = tree
tree.innerText = getTxtName(thisFileName)

showMe frmTree,frmSeach
showFolder tree

sub showLn
Ln.innerText = cint((window.event.offsetY-2)/15)+1
end sub

sub shortCut

if window.event.keyCode=83 and window.event.ctrlKey then
if currentFile<>"" then saveFile
window.event.cancelBubble = true
window.event.returnValue = false
end if
if window.event.keyCode=66 and window.event.ctrlKey then
browseMe
window.event.cancelBubble = true
window.event.returnValue = false
end if

if window.event.keyCode=78 and window.event.ctrlKey then
createFile
window.event.cancelBubble = true
window.event.returnValue = false
end if

end sub
sub browseMe
dim win
set win=window.open()
win.document.write txt.value
end sub

sub createFile