`

工具>FileFormatTxt.hta (v0.1文件转txt格式)

阅读更多
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">   
<html>   
<head>   
<title>package file v0.1</title>   
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">   
<HTA:APPLICATION    
    ID="package file v0.1"    
    APPLICATIONNAME="package file v0.1"    
    VERSION="0.1"    
    SCROLL="no"    
    INNERBORDER="no"    
    CONTEXTMENU="yes"    
    CAPTION="yes"    
    ICON="no"    
    SHOWINTASKBAR="yes"    
    SINGLEINSTANCE="yes"    
    SYSMENU="yes"    
    MAXIMIZEBUTTON ="no"  
    WINDOWSTATE="normal"  
    NAVIGABLE="yes"  
    />   
  
<SCRIPT LANGUAGE="VBScript">   
  
function transfert()   
  
    dim filename   
  
    filename = document.getElementById("srcFile").value   
       
    if len(filename)>0 then   
  
        dim oReq       
  
        'on error resume next   
        '//创建XMLHTTP对象   
        set oReq    = CreateObject("MSXML2.XMLHTTP")   
  
            oReq.open "get","file:\\" & filename,false  
            oReq.send    
  
        ff = oReq.responseBody   
  
        dim u,s,kk   
  
        u = lenb(ff)   
  
        redim kk(u-1)   
  
        for i=0 to u-1  
            s = hex(ascb(midb(ff,i+1,1)))   
            if len(s)<2 then   
                s = "0" & s   
            end if  
            'kk = kk & s   
            kk(i) = s   
        next   
  
        make filename,join(kk,"")   
  
    else  
        document.getElementById("srcFile").focus   
        msgbox "请选择要压缩的文件",16,"提示"  
  
    end if  
       
end function  
function make(filename,data)   
  
    dim htm,file   
  
    file = mid(filename,instrrev(filename,"\")+1)   
  
    htm = htm & "<html>"                  & vbcrlf   
    htm = htm & "<head>"                  & vbcrlf   
    htm = htm & "<title>selfdec</title>"    & vbcrlf   
    htm = htm & "<meta http-equiv=""Content-Type"" content=""text/html; charset=GB2312"">" & vbcrlf   
    htm = htm & "<HTA:APPLICATION "          & vbcrlf   
    htm = htm & "   ID=""selfdec"" "        & vbcrlf   
    htm = htm & "   APPLICATIONNAME=""self"" " & vbcrlf   
    htm = htm & "   VERSION=""0.1"" "       & vbcrlf   
    htm = htm & "   SCROLL=""no"" "         & vbcrlf   
    htm = htm & "   INNERBORDER=""no"" "    & vbcrlf   
    htm = htm & "   CONTEXTMENU=""no"" "    & vbcrlf   
    htm = htm & "   CAPTION=""no"" "        & vbcrlf   
    htm = htm & "   ICON=""no"" "           & vbcrlf   
    htm = htm & "   SHOWINTASKBAR=""no"" "  & vbcrlf   
    htm = htm & "   SINGLEINSTANCE=""yes"" "& vbcrlf   
    htm = htm & "   SYSMENU=""no"" "        & vbcrlf   
    htm = htm & "   MAXIMIZEBUTTON =""no""" & vbcrlf   
    htm = htm & "   WINDOWSTATE=""normal""" & vbcrlf   
    htm = htm & "   NAVIGABLE=""yes"""      & vbcrlf   
    htm = htm & "   />"                      & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "<SCRIPT LANGUAGE=""VBScript"">"      & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "'//保存文件"               & vbcrlf   
    htm = htm & "function saveFile(filename,str)"       & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   set adodbStream = CreateObject(""ADODB"" & ""."" & ""Stream"")" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   adodbStream.Type= 1"    & vbcrlf   
    htm = htm & "   adodbStream.Open"       & vbcrlf   
    htm = htm & "   adodbStream.write str"  & vbcrlf   
    htm = htm & "   adodbStream.SaveToFile filename,2" & vbcrlf   
    htm = htm & "   adodbStream.Close"      & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "end function"              & vbcrlf   
    htm = htm & ""                          & vbcrlf
htm = htm & "'//VB数组转变成二进制格式" & vbcrlf   
    htm = htm & "Function MultiByteToBinary(MultiByte)" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   Dim RS, LMultiByte, Binary"         & vbcrlf   
    htm = htm & "   Const adLongVarBinary = 205"        & vbcrlf   
    htm = htm & "   Set RS = CreateObject(""ADODB.Recordset"")" & vbcrlf   
    htm = htm & "   LMultiByte = LenB(MultiByte)"       & vbcrlf   
    htm = htm & "   If LMultiByte>0 Then"    & vbcrlf   
    htm = htm & "       RS.Fields.Append ""mBinary"", adLongVarBinary, LMultiByte"  & vbcrlf   
    htm = htm & "       RS.Open"            & vbcrlf   
    htm = htm & "       RS.AddNew"          & vbcrlf   
    htm = htm & "       RS(""mBinary"").AppendChunk MultiByte & ChrB(0)"            & vbcrlf   
    htm = htm & "       RS.Update"          & vbcrlf   
    htm = htm & "       Binary = RS(""mBinary"").GetChunk(LMultiByte)"              & vbcrlf   
    htm = htm & "   End If"                 & vbcrlf   
    htm = htm & "   MultiByteToBinary = Binary"         & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "End Function"              & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "function DeleteMe()"       & vbcrlf   
    htm = htm & "   "                       & vbcrlf   
    htm = htm & "   dim filename"           & vbcrlf   
    htm = htm & "   filename    = document.location.href" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   filename    = mid(filename,instrrev(filename,""/"")+1)" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   Dim fso, MyFile"        & vbcrlf   
    htm = htm & "   Set fso     = CreateObject(""Script" & "ing.FileS" & "ystemObject"")    " & vbcrlf   
    htm = htm & "   Set MyFile  = fso.GetFile(filename)" & vbcrlf   
    htm = htm & "       MyFile.Delete"      & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "end function"              & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "function exec()"           & vbcrlf   
    htm = htm & "   "                       & vbcrlf   
    htm = htm & "   '//屏蔽错误"            & vbcrlf   
    htm = htm & "   'on error resume next"  & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   '//改变窗体大小"      & vbcrlf   
    htm = htm & "   window.resizeTo 0,0"    & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   dim data,t,kk,filename" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   '//得到数据"            & vbcrlf   
    htm = htm & "   data        = document.getElementById(""divData"").innerText" & vbcrlf   
    htm = htm & "   '//得到文件名"           & vbcrlf   
    htm = htm & "   filename    = document.getElementById(""divFileName"").innerText" & vbcrlf  
htm = htm & ""                          & vbcrlf   
    htm = htm & "   '//得到数据长度"      & vbcrlf   
    htm = htm & "   u = len(data)"          & vbcrlf   
    htm = htm & "   "                       & vbcrlf   
    htm = htm & "   '//获得文件数组"      & vbcrlf   
    htm = htm & "   for i=1 to u step 2"    & vbcrlf   
    htm = htm & "       t = mid(data,i,2)"  & vbcrlf   
    htm = htm & "       kk = kk & ChrB(clng(""&H"" & t))" & vbcrlf   
    htm = htm & "   next"                   & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   '//转变成二进制格式"    & vbcrlf   
    htm = htm & "   dataArry = MultiByteToBinary(kk)"   & vbcrlf   
    htm = htm & "   "                       & vbcrlf   
    htm = htm & "   '//保存文件 "           & vbcrlf   
    htm = htm & "   saveFile filename,dataArry"         & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   '//删除自己"            & vbcrlf   
    htm = htm & "   DeleteMe"               & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "   '//关闭自己"            & vbcrlf   
    htm = htm & "   window.opener = nothing"& vbcrlf   
    htm = htm & "   window.close"           & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "end function"              & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "<" & "/SCRIPT>"          & vbcrlf   
    htm = htm & "<" & "/head>"                & vbcrlf   
    htm = htm & "<body marginleft=0 marginright=0 onload=""exec()"">" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "<div id=""divFileName"" style=""display:none;"">" & file & "</div>" & vbcrlf   
    htm = htm & "<div id=""divData""     style=""display:none;"">" & data & "</div>" & vbcrlf   
    htm = htm & ""                          & vbcrlf   
    htm = htm & "</body>"                 & vbcrlf   
    htm = htm & "</html>"                 & vbcrlf  
dim fso,f   
       
    dim this_file   
        this_file = file & "-pf.hta"  
  
    Set fso = CreateObject("Scripting.FileSystemObject")   
    Set f = fso.OpenTextFile(this_file, 2, True)   
        f.Write htm   
  
    msgbox "生成文件" & this_file & "成功!",64,"生成"  
  
  
end function   
  
  
</SCRIPT>   
</head>   
  
<body marginleft=0 marginright=0 onload="window.resizeTo 389,145 ">   
  
请选择文件:<input type=file id="srcFile" style="width:260px;"><br><br>   
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value="  转换  " onclick="transfert">&nbsp;&nbsp;<input type=button value="  关闭  " onclick="window.close">   
  
</body>   
</html>  

 

分享到:
评论

相关推荐

    接口测试工具V1.0.hta

    接口测试工具V1.0.hta的实现可能包括以下功能: 1. **请求构造**:用户可以输入或选择URL、HTTP方法、请求头以及请求体数据,如JSON或表单数据。 2. **参数化**:支持动态参数,允许用户使用变量或表达式进行测试...

    硬盤整數-分區計算器-bat文件-硬盤分區計算器.hta

    硬盤整數-分區計算器-bat文件-硬盤分區計算器.hta

    轨迹离线播放器V1.1.hta

    1. **数据导入**:支持多种格式的数据导入,如GPX、KML、CSV等,这些都是常见的轨迹数据文件格式,用于存储地理位置信息。 2. **地图显示**:内建地图引擎,能够显示地图背景,并且可以在不同地图类型(如卫星图、...

    exe转换16进制.hta

    exe转换16进制.hta 能文件改成十六进制的

    CMD命令帮助集合.hta

    "CMD命令帮助集合.hta" 文件则是一个汇集了CMD常用命令的资源,旨在帮助用户快速查询和理解各种命令的用法。 hta文件是一种HTML应用程序(HTML Application),它可以像网页一样运行,但具有更大的交互性和执行权限...

    test_v1.6.hta

    test_v1.6.hta

    ITabcWork.A.hta

    ITabcWork.A.hta

    JavaScript版的俄罗斯方块 wzTetris.hta

    JavaScript版的俄罗斯方块,在Windows运行,wzTetris.hta。

    一个HTA的工具,使用美国变星观测者协会的基本计划建立一个观测计划.hta

    一个HTA的工具,使用美国变星观测者协会的基本计划建立一个观测计划.hta

    二进制转换成txt或html格式文件查看工具

    二进制转换成TXT或HTML格式文件查看工具是一种实用程序,它帮助用户将二进制数据转化为可以直观阅读的文本或网页形式。这个工具的便捷性和易用性使得它成为处理二进制数据的得力助手。 首先,我们来探讨二进制转换...

    可以插入视频、音乐的.htaDEMO(用来哄女朋友不错).hta

    用户在下载并解压后,可以直接运行.hta文件体验DEMO,同时可以查看和编辑源代码,从而进行个性化的改造。 总结来说,“可以插入视频、音乐的.htaDEMO”是一个富有创意的HTML应用程序实例,它充分利用了HTA技术的...

    合并当前路径下所有的excel.hta

    合并当前路径下所有的excel.hta,资源如名字,使用ado读取excel到activeX,递归遍历脚本所在目录下的所有子目录,需要支持&lt;object classid="clsid:0002E559-0000-0000-C000-000000000046" id="Spreadsheet1"/&gt;...

    hta格式程序详解

    `&lt;HTA:application&gt;`标签是HTA中最关键的部分之一,它用于声明该文件为HTA应用,并设置应用的各种属性。下面详细介绍一些常用属性: - **ApplicationName**: 设置应用名称。 - **Border**: 定义窗口边框样式,默认...

    hta文件制作教程.7z

    6. **调试与测试**:你可以直接双击HTA文件进行运行和测试,但为了调试脚本,可以使用Visual Studio或Internet Explorer的开发者工具。 7. **分发与执行**:HTA文件本质上是可执行文件,可以通过双击运行。如果需要...

    jsvm打包工具(将多个JSC打包成JS文件)

    除了`jar.hta`,压缩包中还包含`readme.txt`,这通常是一个包含了工具使用说明和注意事项的文本文件。务必仔细阅读,以便更好地理解和操作打包工具。 另外,`jsvm2`可能是指JSVM2的主文件或者是一套相关的库文件,...

    HTA版资源文件编码转换器native2ascii

    通常,Java的`native2ascii`命令行工具用于将本地编码的文本文件转换为ASCII编码,以符合Java的属性文件格式要求,但这个HTA版本可能提供了一个图形化的用户界面,使得操作更为直观和方便,尤其是对于不熟悉命令行...

    hta编写的软件管理工具0.1(ie7.0测试通过).pdf

    3. **搜索与存储**:工具提供一个名为"searchresult.txt"的文件,用户可以根据搜索结果选择要存储在哪个分类,数据会被自动存入数据库。 4. **用户交互界面**:HTML代码展示了用户界面的一些元素,如按钮和输入框,...

    汉字转拼音工具(hta源码)

    本文将深入探讨一款基于hta源码的汉字转拼音工具,解析其工作原理,并提供相关的应用实例。 一、hta源码与hta技术 HTA(HTML Applications)是微软开发的一种技术,它允许开发者创建基于HTML、CSS和JavaScript的...

    正则表达式测试工具(HTA格式)

    由于HTA文件不需要任何DLL支持,因此该正则表达式测试工具非常轻便,易于使用。 这款名为"regexp.hta"的应用程序,设计简洁,专为测试正则表达式而生。用户可以直接双击运行此文件,无需安装额外的组件。在打开的...

Global site tag (gtag.js) - Google Analytics