华域联盟 vbs HTA文件去除html控件认证和接收命令行参数

HTA文件去除html控件认证和接收命令行参数

一是利用hta 去掉htm的控件验证

hta1的代码如下:

<html> 
<head> 
<title>Sample HTML Application one</title> 
</head> 
<body onload="Viewer.document.location.href='activexcontrol.htm'"> 
<iframe id="Viewer" application="yes"><!--这里是去掉验证的关键--> 
</iframe> 
</body> 
</html> 

activexcontrol.htm代码如下:

<script language="VBSCRIPT"> 
Dim FileSystem 
' Creates the FileSystemObject 
Set FileSystem = CreateObject("Scripting.FileSystemObject") 
</script> 

这样就可以去掉htm的本地验证了。

二、hta接收命令行参数

书中的代码我估计有错,不可能成功,我研究了一下,hta2应当这样写:

<HTA:APPLICATION 
ID="MySampleHTA" 
Caption="yes"> 
<html> 
<head> 
<title>Sample HTML Application two</title> 
</head> 
<body> 
<script language="VBScript"> 
cmdLineArray = Split(MySampleHTA.commandLine)‘这是把命令中的参数变成数组 
MsgBox cmdLineArray(UBound(cmdLineArray)) '接收最后一个参数 
a=document.getElementById("MySampleHTA").commandLine '这样写法是一个字符串,不是数组 
MsgBox TypeName(a)&"--"&a '验证 
</script> 
</body> 
</html> 

在命令行下:hta2 lcx 就会弹出lcx的对话框

您可能感兴趣的文章:

本文由 华域联盟 原创撰写:华域联盟 » HTA文件去除html控件认证和接收命令行参数

转载请保留出处和原文链接:https://www.cnhackhy.com/15723.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部