- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我得到了一些代码来模拟使用 HTML 和 CSS 的等待栏,所以我想添加一个 HTA 以使用 vbscript 动态生成。如果你们中的任何人都可以帮助我使用等待栏来显示滚动文本。提前谢谢你!
问题原代码=> VBScript script progress notification
我在 HTA 中修改的代码:
<HTML>
<HEAD>
<Title>Recherche dans le contenu des fichiers de type texte (Version modifié © Hackoo)</Title>
<HTA:APPLICATION
ICON = "magnify.exe"
BORDER="THIN"
INNERBORDER="NO"
MAXIMIZEBUTTON="NO"
MINIMIZEBUTTON="NO"
SCROLL="NO"
SYSMENU="NO"
SELECTION="NO"
SINGLEINSTANCE="YES">
<style type="text/css">
* {
//font-size: 1px;
margin: 1px;
}
div {
position: absolute;
left: 28%;
top: 50%;
}
marquee {
border: 1px solid;
height: 25px;
width: 200px;
}
marquee span {
height: 20px;
width: 20px;
background: Red;
float: left;
}
.handle-0 { filter: alpha(opacity=20); -moz-opacity: 0.20; }
.handle-1 { filter: alpha(opacity=40); -moz-opacity: 0.40; }
.handle-2 { filter: alpha(opacity=60); -moz-opacity: 0.6; }
.handle-3 { filter: alpha(opacity=80); -moz-opacity: 0.8; }
.handle-4 { filter: alpha(opacity=100); -moz-opacity: 1; }
</style>
</HEAD>
<BODY text="white"><CENTER><DIV><SPAN ID="ProgressBar"></SPAN>
<span><marquee DIRECTION="LEFT" SCROLLAMOUNT="3" BEHAVIOR=ALTERNATE><font face="Comic sans MS">Veuillez patienter.la recherche du mot <FONT COLOR='yellow'><B>"Wscript"</B></FONT> est en cours...</font></marquee></span></DIV></CENTER></BODY></HTML>
<div>
<marquee direction="right" scrollamount="8" scrolldelay="100">
<span class="handle-0"></span>
<span class="handle-1"></span>
<span class="handle-2"></span>
<span class="handle-3"></span>
<span class="handle-4"></span>
</marquee>
</div>
<SCRIPT LANGUAGE="VBScript">
Set ws = CreateObject("wscript.Shell")
Temp = WS.ExpandEnvironmentStrings("%Temp%")
Sub window_onload()
CenterWindow 480,120
Self.document.bgColor = "orange"
End Sub
Sub CenterWindow(x,y)
Dim iLeft,itop
window.resizeTo x,y
iLeft = window.screen.availWidth/2 - x/2
itop = window.screen.availHeight/2 - y/2
window.moveTo ileft,itop
End Sub
</script>
最佳答案
我在 Vbscript 中解决了我的问题,在 HTA 中生成等待栏:
'Détermination de l'itinéraire vers les URL(s) saisi par l'utilisateur dans l'InputBox avec la commande DOS "Tracert" animé par une barre de progression
'Date de Création le 06/09/2013 © Hackoo
'Mise à jour le 04/05/2014 : Ajout d'un message d'attente animé par la balise <marquee>
'*********************************Déclaration des variables globales*******************************
Option Explicit
Dim oExec,fso,ws,Temp,Voice,Copyright,Title
Copyright = " Hackoo © 2014"
Set ws = CreateObject("wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Temp = ws.ExpandEnvironmentStrings("%Temp%")
Set Voice = CreateObject("SAPI.SpVoice")
'**************************************************************************************************
'Appel au programme principal ou on peut intégrer la barre de progression
Call MonProgramme()
'**************************************************************************************************
Sub MonProgramme()
Dim Command,Command2,Res,LogFile,StrCommand,Argum,startlog,MsgTitre,Titre,MsgAttente,StartTime,DurationTime
MsgTitre = "Traceroute d'une URL © Hackoo © 2014"
StrCommand = "Tracert"
Argum = InputBox("Taper l'adresse d'une URL pour déterminer son itinéraire avec la commande DOS "& DblQuote("Tracert"),MsgTitre,"www.stackoverflow.com")
LogFile = StrCommand & "Log.txt"
If fso.FileExists(LogFile) Then fso.DeleteFile LogFile
Command = "Cmd /c "& StrCommand & " " & Argum &" >> "&LogFile&""
Titre = "La traceroute vers "& DblQuote(Argum) &" est en cours..."
Title = Titre + Copyright
MsgAttente = Titre
Call CreateProgressBar(Titre,MsgAttente)'Creation de barre de progression
Voice.Speak "Please Wait a While !"
Call LancerProgressBar()'Lancement de la barre de progression
StartTime = Timer'Début du Compteur Timer
Res = Ws.Run(Command,0,True)'Exécution de la Commande
DurationTime = FormatNumber(Timer - StartTime, 0) & " seconds."'La durée de l'exécution du script
Call Formater(LogFile)'Pour formater et remplacer les caractères spéciaux unicode dans le LogFile
Call FermerProgressBar()'Fermeture de barre de progression
Voice.Speak "Process of TraceRoute finished in "& DurationTime &" !"
ws.popup "La TraceRoute vers "& DblQuote(Argum) &" est terminée dans "& vbcr & DurationTime,"2",MsgTitre,64
ws.popup Formater(LogFile),"5",MsgTitre,64
Command2 = "Cmd /c Start "&LogFile&""
startlog = Ws.Run(Command2,0,False)
End Sub
'****************************************************************************************************
Sub CreateProgressBar(Titre,MsgAttente)
Dim ws,fso,f,f2,ts,ts2,Ligne,i,fread,LireTout,NbLigneTotal,Temp,PathOutPutHTML,fhta,oExec
Set ws = CreateObject("wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Temp = WS.ExpandEnvironmentStrings("%Temp%")
PathOutPutHTML = Temp & "\Barre.hta"
Set fhta = fso.OpenTextFile(PathOutPutHTML,2,True)
fhta.WriteLine "<HTML>"
fhta.WriteLine "<HEAD>"
fhta.WriteLine "<Title> " & Title & "</Title>"
fhta.WriteLine "<HTA:APPLICATION"
fhta.WriteLine "ICON = ""magnify.exe"" "
fhta.WriteLine "BORDER=""THIN"" "
fhta.WriteLine "INNERBORDER=""NO"" "
fhta.WriteLine "MAXIMIZEBUTTON=""NO"" "
fhta.WriteLine "MINIMIZEBUTTON=""NO"" "
fhta.WriteLine "SCROLL=""NO"" "
fhta.WriteLine "SYSMENU=""NO"" "
fhta.WriteLine "SELECTION=""NO"" "
fhta.WriteLine "SINGLEINSTANCE=""YES"">"
fhta.WriteLine "<style type=""text/css"">"
fhta.WriteLine "div {left: 2%; top: 50%;}"
fhta.WriteLine "marquee { height: 25px; width: 450px;}"
fhta.WriteLine "marquee span {height: 20px; width: 20px; background: Red;float: left;}"
fhta.WriteLine ".handle-0 { filter: alpha(opacity=20); -moz-opacity: 0.20; }"
fhta.WriteLine ".handle-1 { filter: alpha(opacity=40); -moz-opacity: 0.40; }"
fhta.WriteLine ".handle-2 { filter: alpha(opacity=60); -moz-opacity: 0.60; }"
fhta.WriteLine ".handle-3 { filter: alpha(opacity=80); -moz-opacity: 0.80; }"
fhta.WriteLine ".handle-4 { filter: alpha(opacity=100); -moz-opacity: 1; }"
fhta.WriteLine "</style>"
fhta.WriteLine "</HEAD>"
fhta.WriteLine "<BODY text=""white""><CENTER><DIV><SPAN ID=""ProgressBar""></SPAN>"
fhta.WriteLine "<span><marquee DIRECTION=""LEFT"" SCROLLAMOUNT=""3"" BEHAVIOR=ALTERNATE><font face=""Comic sans MS"">" & MsgAttente &"</font></marquee></span></DIV></CENTER></BODY></HTML>"
fhta.WriteLine "<div>"
fhta.WriteLine "<marquee direction=""right"" scrollamount=""10"" BEHAVIOR=ALTERNATE>"
fhta.WriteLine "<span class=""handle-0""></span>"
fhta.WriteLine "<span class=""handle-1""></span>"
fhta.WriteLine "<span class=""handle-2""></span>"
fhta.WriteLine "<span class=""handle-3""></span>"
fhta.WriteLine "<span class=""handle-4""></span>"
fhta.WriteLine "</marquee>"
fhta.WriteLine "</div>"
fhta.WriteLine "<SCRIPT LANGUAGE=""VBScript""> "
fhta.WriteLine "Set ws = CreateObject(""wscript.Shell"")"
fhta.WriteLine "Temp = WS.ExpandEnvironmentStrings(""%Temp%"")"
fhta.WriteLine "Sub window_onload()"
fhta.WriteLine " CenterWindow 480,110"
fhta.WriteLine " Self.document.bgColor = ""DarkOrange"" "
fhta.WriteLine " End Sub"
fhta.WriteLine " Sub CenterWindow(x,y)"
fhta.WriteLine " Dim iLeft,itop"
fhta.WriteLine " window.resizeTo x,y"
fhta.WriteLine " iLeft = window.screen.availWidth/2 - x/2"
fhta.WriteLine " itop = window.screen.availHeight/2 - y/2"
fhta.WriteLine " window.moveTo ileft,itop"
fhta.WriteLine "End Sub"
fhta.WriteLine "</script>"
fhta.close
End Sub
'**********************************************************************************************
Sub LancerProgressBar()
Set oExec = Ws.Exec("mshta.exe " & Temp & "\Barre.hta")
End Sub
'**********************************************************************************************
Sub FermerProgressBar()
oExec.Terminate
End Sub
'**********************************************************************************************
'Fonction pour ajouter les doubles quotes dans une variable
Function DblQuote(Str)
DblQuote = Chr(34) & Str & Chr(34)
End Function
'**********************************************************************************************
'Fonction pour formater et remplacer les caractères spéciaux unicode dans le LogFile
Function Formater(File)
Dim fso,fRead,fWrite,Text
Set fso = CreateObject("Scripting.FileSystemObject")
Set fRead = fso.OpenTextFile(File,1)
Text = fRead.ReadAll
fRead.Close
Set fWrite = fso.OpenTextFile(File,2,True)
Text = Replace(Text,"‚","é")
Text = Replace(Text,"ے"," ")
Text = Replace(Text,"ˆ","ê")
Text = Replace(Text,"‡","ç")
Text = Replace(Text,"“","ô")
Text = Replace(Text,"…","à")
Text = Replace(Text,"ٹ","è")
Text = Replace(Text,"ƒ","â")
Text = Replace(Text,"?"," ")
fWrite.WriteLine Text
Formater = Text
End Function
'***********************************************************************************************
关于html - HTA 和 CSS 中的等待栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23401151/
我有一个运行良好的 HTA 文件,但我的问题是我希望在文件运行时隐藏 HTA 控制台。 这是我的代码: var myVar = setInterval(function(){ myTimer() }
我写了一个 HTML 应用程序(hta 文件),想知道是否有办法将图标文件嵌入到 hta 文件本身中。 我见过包含嵌入式图形文件的 html 电子邮件,有没有办法用 html 应用程序和图标来做到这一
我有一个 HTA,我总是希望它具有相同的尺寸。我已经通过使用 注意 - 如果您想允许用户滚动,请将 SCROLL 字符串从 NO 更改为 >是 关于hta - 防止 HTA 窗口调整大小,我们在St
有什么方法可以更改 HTA 应用程序的大小吗? 谢谢 最佳答案 window.resizeTo(300,290); 关于hta - 更改 HTA 应用程序窗口大小,我们在Stack Ove
我正在尝试创建一个允许用户将数据添加到文本文件的 HTA 文件。我在该领域相当缺乏经验。 我需要完成一些事情: 将输入的数据写入文本文件(我的代码就是这样做的) 让用户从可用文件的下拉列表中选择要写入
全新的 HTA。我有 HTML 页面,允许用户为我们的一个应用程序提交密码请求。在机器升级到 Windows 10 之前一切正常,我不再有权获取对象电子邮件和用户帐户。好消息,如果我将文件另存为 HT
我想构建一个可以像 Web 浏览器一样加载 Web 的应用程序。但我希望它看起来像应用程序或像 .exe。当我双击时,它将运行应用程序并加载网络。 我的目标是: 应用程序加载全屏。 有否 工具栏、地址
我有两个选择下拉菜单。当我从第一个下拉列表中选择时,第二个下拉列表中的条目应该更改。此功能在浏览器中运行良好,但在 HTA(HTML 应用程序)中运行不正常 我的代码 function chan
如何最小化窗口? 我正在制作 HTA 应用程序,我想用我的自定义标题栏替换窗口标题栏。我已通过 HTA 的“caption=no”选项禁用了它,并放置了我自己的最小化/最大化/关闭按钮。 我找到了两种
我想获取当前用户的用户名,然后在我的应用程序名称中创建一个链接 链接看起来像 http://localhost/?id=username 我试过了 Dim objNetworkSet objNetwo
批处理文件中的以下代码通过 HTA 对话框从用户处获取密码。它工作正常。我想传递一个变量值 !user[%%a]!显示在弹出的 HTA 对话框中,这样我就可以看到输入用户 ID 的密码:“BATCH
我有一个 HTML 应用程序,我想保留在所有窗口的顶部(也就是说,如果打开/切换到另一个窗口,我希望这个窗口覆盖它)。 JavaScript 解决方案在 Windows 7/IE9 模式下不起作用(不
我有一个 JavaScript 函数,它首先获取标签元素的值,该元素是数据库条目的 ID。然后,这些 ID 被发送到 ASP 页面,该页面从数据库中获取图像保存位置。 然后将每个选定图像的保存位置信息
在我创建的几个 .HTA 脚本中,我需要 VBScript WScript.Sleep 命令,它只是等待几毫秒而不使用 CPU。当我浏览网页时,似乎我不是唯一一个在寻找这个的人: https://ww
是否可以向 hta 添加自定义图标?我的意思是更改默认的 hta 文件图标,即“系统应用程序图标”。可以在不为扩展分配新图标并且不使用文件快捷方式的情况下完成吗?像这样 最佳答案 WinRAR 可以帮
每次当我尝试使用 vbscript 在 hta 文件中添加 javascript 时,当我单击提交按钮时,都会出现一条错误消息: object doesn't support this propert
第一次发帖,网站的长期读者。我搜索了整个 Internet,找不到可行的解决方案,而且我尝试了很多重写,但无法修复它。 我为工作编写 HTA 文件。通常是部门特定的笔记工具,使他们的工作更轻松。除了复
所以我尝试为我的 .bat 文件使用 ScriptGUI(来自 here),但它没有文件选择器,所以我尝试添加一个。 我只是复制并重命名了一些代码,它似乎可以工作,除了为子函数添加另一个变量。
我的任务是创建几个数据库供办公室本地使用,一个用于记录病假电话,另一个用于记录员工出租车。 我无法在将用于开发应用程序的机器或将使用该应用程序的机器上安装新软件,因此不幸的是没有基于 xAMP 的应用
我有一个主要用 VBScript 编写的 HTML 应用程序。 应用程序每 10 分钟刷新一次,刷新的一部分是正在重新定位的窗口。但是,我不想通过重新定位窗口并使其在当前窗口前弹出(赋予它焦点)来打扰
我是一名优秀的程序员,十分优秀!