嗯,它有效,它只是没有产生任何有价值的东西:
elems = document.getElementById("itemsTable").getElementsByTagName("TR")
for j = 0 to ubound(elems) - 1
' stuff
next
Run Code Online (Sandbox Code Playgroud)
嗯,那不行,显然elems是一个对象,而不是像你在那个花哨的javascript中得到的数组.我虽然坚持使用vbscript.
那么我该怎么做才能迭代vbscript中表中的所有行?
编辑:是的,它是vbscript而且很糟糕.我这里没有选择,所以不要说"使用jQuery !!".
我已经制作了一个vbscript来定位一些计算机并对它们进行wmi查询,我的老板希望将这些数据放在一个文档中.问题是该文档是一个Microsoft Word文档,其中包含嵌入的excel对象.现在我已经在google上进行了广泛搜索,无论如何都可以使用OLE来定位和操作对象内部和对象,但我似乎无处可去.
所以我的问题是,如果有人有一些代码,我可以查看或者可能是一个教程,甚至可以告诉我它是否可能?
我有一个VB脚本,它添加了Windows Startup文件夹的程序快捷方式.在我的脚本中,我能够使用以下方法检索32位Windows中的Startup文件夹位置:
Set objShell = CreateObject("WScript.Shell")
startupFolder = objShell.SpecialFolders("Startup")
Run Code Online (Sandbox Code Playgroud)
但是当我在64位Windows上尝试时,它什么都不返回.具体来说,我正在测试64位Vista.我似乎无法找到适当的环境变量或语法.谢谢.
我有以下代码:
function p (str)
Response.Write VBLF & str
end function
function nop: end function
class Test1
private sub class_initialize
p "Test1 Start"
end sub
private sub class_terminate
p "Test1 End"
end sub
end class
class Test2
private sub class_initialize
p " Test2 Start"
end sub
private sub class_terminate
p " Test2 End"
end sub
end class
Run Code Online (Sandbox Code Playgroud)
当我跑:
with new Test1
with new Test2
end with
end with
Run Code Online (Sandbox Code Playgroud)
我期待输出:
Test1 Start
Test2 Start
Test2 End
Test1 End
Run Code Online (Sandbox Code Playgroud)
但我得到:
Test1 Start
Test2 …Run Code Online (Sandbox Code Playgroud) 如何从ASP中的字符串中找到特定值?
dim temp="alpha,bravo,charlie"
Run Code Online (Sandbox Code Playgroud)
我如何找到temp中是否存在'alpha'?
谢谢
我有一个二进制字符串,我需要写入文件.我有一种感觉,这应该是一个简单的过程,但再次,VBScript.该FileSystemObject是没有帮助的,因为它munges数据.Stream使用它adBinaryMode和它的Write方法,该对象看起来很有前景,但该Write方法需要一个字节数组,而不是接受变量数组.因为VBScript数组是所有变型数组,这似乎是有问题的.
那么,我如何将数据写入文件?
编辑:我应该补充说,整个事情必须是VBScript.没有额外的组件.对不起,我也不喜欢它.
嗨,伙计们,我必须将3个二进制文件连接成一个,但我得到一个错误,而我在这里尝试它是我的代码
' This is a simple example of managing binary files in
' vbscript using the ADODB object
dim inStream,outStream
const adTypeText=2
const adTypeBinary=1
' We can create the scream object directly, it does not
' need to be built from a record set or anything like that
set inStream=WScript.CreateObject("ADODB.Stream")
' We call open on the stream with no arguments. This makes
' the stream become an empty container which can be then
' used for what operations we want …Run Code Online (Sandbox Code Playgroud) 我一直在寻找如何从经典asp调用存储过程并将参数传递给它下面是我的存储过程工作正常
CREATE PROCEDURE Paging_Movies
@alphaChar char(1)
AS
if @alphaChar = '#'
select * from Movies where movies like '[^a-z]%'
else
select * from Movies where movies like @alphaChar + '%'
Run Code Online (Sandbox Code Playgroud)
和我的vbscript代码到目前为止 -
Set objCon = CreateObject("ADODB.Connection")
Set objRS = CreateObject("ADODB.Recordset")
set objComm = CreateObject("ADODB.Command")
objCon.Open "Provider=SQLOLEDB.1;Password=xxxx;Persist Security Info=True;User ID=xxxx;Initial Catalog=Movies;Data Source=xxxx-PC"
objComm.ActiveConnection = objCon
objComm.CommandType = 4
objComm.CommandText = "Paging_Movies"
objRS.open objComm.CommandText, objCon
Run Code Online (Sandbox Code Playgroud) 我需要将1-320范围内的值转换为500-2500范围内的扩展中的等效值,我需要在VBScript中进行.
是否有类似于map()的函数可以为我做这个?我不能在这个特定的用例中包含任何外部库.