网站首页  汉语字词  英语词汇  考试资料  写作素材  旧版资料

请输入您要查询的范文:

 

标题 HTA文件去除html控件认证和接收命令行参数
范文
    最近看vbscript程序员参考手册第三版,讲到hta的两个应用
    一是利用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的对话框
随便看

 

在线学习网范文大全提供好词好句、学习总结、工作总结、演讲稿等写作素材及范文模板,是学习及工作的有利工具。

 

Copyright © 2002-2024 cuapp.net All Rights Reserved
更新时间:2025/5/13 21:30:36