English 中文(简体)
标本不起作用, 语句错误结束或丢失 )
原标题:vbscript not working, end of statement error or missing )

试图做一个 vbscript, 将所有内容都列在 dir 中, 并阅读每个文件来提取数据, 以便使用此数据作为参数来操作和运行一个电动弹壳脚本 。 我找到了以下数据可以启动, 但是它不起作用 。 有人能帮助吗?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      make a reference to a directory
    Dim di As New IO.DirectoryInfo("c:")
    Dim diar1 As IO.FileInfo() = di.GetFiles()
    Dim dra As IO.FileInfo

     list the names of all files in the specified directory
    For Each dra In diar1
        ListBox1.Items.Add(dra)
    Next
End Sub
最佳回答

VBScript与VB非常相似, 但它是很长一段时间以来, 我上次使用VB...

AFAIR ListBox1.Items.Add() expects and Item or a string as a parameter, NOT a FileInfo object Try to use ListBox1.Items.Add(FileInfo.FullName)

问题回答

暂无回答




相关问题
Mutually exclusive powershell parameters

SCENARIO I m writing a cmdlet for Powershell 2.0 using Visual Studio 2008 and .NET 3.5 the cmdlet requires 3 arguments. my intended grammar of the cmdlet is something like this: cmdletname [foo|...

Run a program from PowerShell with timeout

I ll write a script that runs a program and wait for it finished. But if the program is not finished within a specified time I want that the program is killed.

How to transpose data in powershell

I have a file that looks like this: a,1 b,2 c,3 a,4 b,5 c,6 (...repeat 1,000s of lines) How can I transpose it into this? a,b,c 1,2,3 4,5,6 Thanks

Powershell v2 remoting and delegation

I have installed Powershell V2 on 2 machines and run Enable-PsRemoting on both of them. Both machines are Win 2003 R2 and are joined to the same active directory domain and I can successfully run ...

PowerShell -match operator and multiple groups

I have the following log entry that I am processing in PowerShell I m trying to extract all the activity names and durations using the -match operator but I am only getting one match group back. I m ...

热门标签