我试图使取消功能适用于我的数组它适用于一个简单的输入框但数组(InputBox(不喜欢它).
工作代码.
If strVarValue = vbNullString Then
MsgBox ("User canceled!")
WScript.Quit
End If
Run Code Online (Sandbox Code Playgroud)
我需要帮助的是什么
strIPAddress = Array(InputBox("IP address"))
If strIPAddress = vbNullString Then
MsgBox ("User canceled!")
WScript.Quit
End If
Run Code Online (Sandbox Code Playgroud)
不喜欢数组,因此为什么我的类型不匹配.
如何在Classic ASP中选择以下选项?
<%
Select case aNumber
case 1 to 2
a="pizza"
case 3 to 4
a="pasta"
case else
a="spaghetti"
end select
%>
Run Code Online (Sandbox Code Playgroud) 我越来越反复出现以下消息错误"第2行中的语句意外结束"我看不出有什么问题吗?我做错了什么..
Sub Main()
Dim regex As Regex = New Regex("\d+")
Dim match As Match = regex.Match("Dot 77 Perls")
If match.Success Then
MessageBox.Show(match.Value)
End If
End Sub
Run Code Online (Sandbox Code Playgroud) 下面是读取的代码excel数据和结果数据转换成hta表格,并编写从编辑的数据hta来excel,在我的hta页面
看起来像这样,如果我选择所需的复选框并单击Click To Write按钮,数据将以"是"或"否"存储在excelsheet中.
<!DOCTYPE html>
<head>
<HTA:application
Applicationname="MyApp"
BORDER="thin"
BORDERSTYLE="Normal"
Caption="yes"
ICON="D:\VBScriptTrainee\Ampeross-Qetto-Icon-developer.ico"
MAXIMIZEBUTTON="yes"
MINIMIZEBUTTON="yes"
SINGLEINSTANCE="no"
NAVIGABLE="yes"
SYSMENU="yes"
VERSION="2.0"
WINDOWSTATE="maximize"/>
<title>Read Excel</title>
<link rel="stylesheet" href="D:\VBScriptTrainee\bootstrap-3.3.6-dist\css\bootstrap.min.css">
<style type="text/css">
body
{
background-color:#1abc9c;
}
P
{
font:bold 18px arial;
}
</style>
<script language="vbscript">
Public mySpan,selectexcel,objExcel,objWorkbook,rowCount,colCount,rowData,textData,sp,b,tempcol,checkData,i,j
On error resume next
Sub ReadExcelData()
Set fileexcel =document.getelementbyid("file_id")
file2=fileexcel.value
'selectexcel = inputbox("Enter the path","path here","D:\VBScriptTrainee\Sample.xlsx")
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.open(file2)
objExcel.visible = …Run Code Online (Sandbox Code Playgroud) 我多次遇到这个问题而且我正在寻找原因.
sql="update setting set hashcode='"&hashcode&"'"
Run Code Online (Sandbox Code Playgroud)
错误:
sql ="update setting set hashcode ='"&hashcode&"'"
---------------------------------------------- ^
Microsoft VBScript编译错误'800a0401'
预期结束声明
请注意,更改哈希码的初始值无效.
但这很好用
sql="update setting set anotherword='"&anotherword&"'"
Run Code Online (Sandbox Code Playgroud)
您是否知道为什么重命名参数可以解决问题?
我有一个脚本,我通过它创建一个IE窗口CreateObject("InternetExplorer.Application").问题是,每当我运行这个脚本时,它总是在我的机器上已经打开的任何其他东西后面打开.我希望这个IE窗口在其他所有内容上打开.它不必像"任务管理器"中的选项一样"始终位于顶部",但它至少应该最初打开.在那之后,我不在乎会发生什么.我已经搜索了高低,并且无法找到实现这一目标的方法.我试过了appactivate,focus()但这些似乎都不起作用.有什么建议?
我用IE 11运行Windows 7
从用户获取2个日期,它的工作原理除外:如果两个日期都在2017年,则显然不应显示错误消息.
我手动将2016年改为2017年,看看它是否有所作为,但没有(使用Replace).
这是验证码:
todays_date = Date()
todays_date = Replace(todays_date, "/", "-")
If m_date_01 < todays_date Or m_date_02 < todays_date Then
m_valid = False
m_message = m_message & "<li>dates cannot be in the past</li>"
End If
response.write(todays_date)
response.write(m_date_01)
response.write(m_date_02)
Run Code Online (Sandbox Code Playgroud) 是否有任何标准方法可以通过命令或任何其他方式在Windows机器中找到已安装JScript和VBScript引擎版本,Powershell例如通过安装的文件版本或任何此类方式?
我有下一个'while'语句,我应该在VB上重写:
while (--number >= 0)
{
result = (char)('A' + number % lettersNumbers) + result;
number /= lettersNumbers;
}
Run Code Online (Sandbox Code Playgroud)
我尝试过这样的事情:
While number >= 0
number = number - 1
result = Chr(Chr("A") + number Mod lettersNumbers) & result
number = number / lettersNumbers
WEnd
Run Code Online (Sandbox Code Playgroud)
但不幸的是它不起作用.我收到下一个错误:
类型不匹配:'[string:"A"]'那么如何更正此代码以使其适用于VBscript?
我知道关于这个主题的其他帖子.但在审查了所有这些内容后,我的案例似乎仍然存在问题.
目前我正在使用a Vbscript将字符串转换为语音的"字符串到语音"功能.(spraak.vbs)VBsript保存在与C代码相同的文件夹中.
带有1个参数的`VBscript文件的内容
rem String to speech
Set spkArgs = WScript.Arguments
arg1 = spkArgs(0)
set speech = Wscript.CreateObject("SAPI.spvoice")
speech.speak arg1
Run Code Online (Sandbox Code Playgroud)
使用sprintf()命令,我将system()命令的总字符串组合在一起.
sprintf(command, "cmd /c spraak.vbs \"Welcome\"");
system(command);
Run Code Online (Sandbox Code Playgroud)
这里使用的代码就像一个魅力.但是当我尝试使用变量作为我的参数时("欢迎").它只说"空".
char text = "\"Welcome\""
sprintf(command, "cmd /c spraak.vbs %s", text);
system(command);
Run Code Online (Sandbox Code Playgroud)
可能是什么问题呢?
完整的C代码如下:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("Test\n");
char text[] = "\"Welcome\"";
char command[] = "";
printf("%s\n", text);
sprintf(command, "cmd /c spraak.vbs \"Welcome\"");
system(command);
sprintf(command, "cmd /c spraak.vbs %s", text);
system(command);
printf("Test2\n");
return 0;
}
Run Code Online (Sandbox Code Playgroud)