Learn to help the stupid Wolf regular practice _hta

Source: Internet
Author: User
<HTML>
<HEAD>
<TITLE> stupid Wolf Regular practice _www.jb51.net cloud Habitat Community </TITLE>
<style>
Body
{
Font-size:12;
BACKGROUND: #DADADA;
margin-left:20;
}

#blockORG
{

Font-family:verdana;
font-size:12px;
Overflow:scroll;
height:300;

}
#fileORG
{
width:400;
}
#blockReg
{
Font-family:verdana;
font-size:12px;
}
#showMe
{
Font-family:verdana;
font-size:12px;
height:200;
overflow:visible;
}
#replaceVar
{
Font-family:verdana;
font-size:12px;
top:341;
}
#isScriptDIV
{
Position:absolute;
top:361;
overflow-x:visible;
}

</style>
</HEAD>

<BODY>
<input type= "File" id= "fileorg" onchange = "vbs:showorg"/>
<button onclick = "vbs:showorg" > Load </button>
<input type= "checkbox" id= "imode" checked ignore case
<input type= "checkbox" id= "Gmode" checked/> Global
<button onclick = "Vbs:back" > Empty </button>
<button onclick = "Vbs:savefile" > Save </button><br/>
<textarea id= "blockorg" ></textArea><br/>
Expression: <input id= "Blockreg"/><br/>
To be replaced by: <input id= "Replacevar"/><input type= "hidden" id= "Jsvalue"/>
<div id= "Isscriptdiv" >
<button id= "Normal" onclick= "Vbs:gogogo" > General replacement </button>
<button id= "Isvbs" onclick= "Vbs:gogogo" >vbs expression substitution </button>
<button id= "Isjs" onclick= "Vbs:gogogo" >js expression substitution </button>
</div>
<textarea id= "ShowMe" ></textArea>
<script language= "VbScript" >
' Set form size
Window.resizeto Window.screen.availwidth,window.screen.availheight
Window.moveto 0,0
BlockORG.style.width = CInt (Window.screen.availWidth * 0.94)
BlockReg.style.width = Px2int (blockORG.style.width)-100

ReplaceVar.style.width = Px2int (blockReg.style.width)-400

IsScriptDIV.style.left = Px2int (replaceVar.style.width) +100
ShowMe.style.width = BlockORG.style.width

Dim fso, Re
Set Re = new REGEXP
Set fso = CreateObject ("Scripting.FileSystemObject")
Dim replacestr

Dim Thisfiledir ' Defines the absolute path to this file
Dim Thisfilename ' defines this file name
Dim Thisfilefolder ' Defines this folder path

Thisfiledir = replace (window.location.href, "file:///", "")
Thisfiledir = unescape (replace (Thisfiledir, "/", "\"))
Thisfilename = LaStone (Thisfiledir, "\")
Thisfilefolder=getfolderdir (Thisfiledir)

Sub Showorg ()
' Load a file in a text box
Dim f,ts,s
If FSO. FileExists (Fileorg.value) Then
Set F = fso. GetFile (Fileorg.value)
Set ts = F.openastextstream (1)
S= ""
If not TS. AtEndOfStream Then
s = ts. ReadAll
End If
Ts. Close
Blockorg.value = S
End If
End Sub

Function LaStone (STR,SPLITSTR)
' Enter characters and delimiters to get the last part
LaStone = Right (Str,len (STR)-instrrev (STR,SPLITSTR))
End Function

function Getfolderdir (fulldir)
' Input get full path, get folder path
S=lastone (Fulldir, "\")
Getfolderdir = Left (Fulldir,len (Fulldir)-len (s))
End Function

function Px2int (px)
Px2int = CInt (replace (px, "px", ""))
End Function

Sub GoGoGo ()
Re.ignorecase = imode.checked
Re.global = gmode.checked
Re.pattern = Blockreg.value
Replacestr = Replacevar.value
Select Case Window.event.srcElement.id
Case "Isvbs"
Replacestr = eval (replacestr)
Case "Isjs"
Window.execscript "Jsvalue.value=eval (Replacevar.value);", "JavaScript"
Replacestr = Jsvalue.value
End Select
Showme.value = Re.replace (BLOCKORG.VALUE,REPLACESTR)
End Sub

Sub Back
Showme.value = ""
End Sub

Sub SaveFile
If FSO. FileExists (Fileorg.value) Then
Set F = fso. GetFile (Fileorg.value)
F.copy Fileorg.value & Makerand () & ". Bak" ' Create backup
Set ts = F.openastextstream (2)
Ts.write Showme.value
Ts. Close
Blockorg.value = Showme.value
Else
Set ts = fso. OpenTextFile (Thisfilefolder & Makerand () & ". txt", 2,true)
Ts.write Showme.value
Ts. Close
Blockorg.value = Showme.value
End If
End Sub

function Makerand ()
Dim Resault
Resault = Mid (CStr (now ()), 3)
Resault =replace (Resault, ":", "")
Resault =replace (Resault, "-", "")
Resault =replace (Resault, "", "")
Makerand = Resault
End Function

</SCRIPT>
</BODY>
</HTML>
The stupid wolf is the practice device. HTA

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.