:),用command 函数啊。
比如说:
dim strCommand as string
strCommand=Commnad()
if strCommnad=.......
比如说:
dim strCommand as string
strCommand=Commnad()
if strCommnad=.......
解决方案 »
- [求助]如何用vb编写程序执行时间加速
- 用RDS查询远程数据库中数据,总是提示:无效的数据源,是何原因?
- 在程序里如何限制不能修改系统时间
- 怎样获得系统当前焦点文本框内的内容?分已经不多了,帮帮忙
- VC版没人能解决的问题,到这里来找答案,是关于ACTIVEX的。(一共300分)
- 问一个很菜的问题!!!求救!!!谢谢!!!
- 谁能告诉我,Datagrid控件用什么方法或属性来实现定位它的单元格。
- acptvb(微软全球技术中心 VB技术支持)兄,有问题请教!!
- 简单的ListView的问题
- 关于mshflexgrid控件!
- 简单问题,送分了!
- 请问如何用INSERT方法赋空值给DATE字段(ACCESS数据库)
本示例在某个函数中用 Command 函数获得命令行参数,并将命令行参数以 Variant 类型之数组返回。Function GetCommandLine(Optional MaxArgs)
'声明变量。
Dim C, CmdLine, CmdLnLen, InArg, I, NumArgs
'检查是否提供了 MaxArgs 参数。
If IsMissing(MaxArgs) Then MaxArgs = 10
' 使数组的大小合适。
ReDim ArgArray(MaxArgs)
NumArgs = 0: InArg = False
'取得命令行参数。
CmdLine = Command()
CmdLnLen = Len(CmdLine)
'以一次一个字符的方式取出命令行参数。
For I = 1 To CmdLnLen
C = Mid(CmdLine, I, 1)
'检测是否为 space 或 tab。
If (C <> " " And C <> vbTab) Then
'若既不是 space 键,也不是 tab 键,
'则检测是否为参数内含之字符。
If Not InArg Then
'新的参数。
'检测参数是否过多。
If NumArgs = MaxArgs Then Exit For
NumArgs = NumArgs + 1
InArg = True
End If
'将字符连接到当前参数中。
ArgArray(NumArgs) = ArgArray(NumArgs) & C
Else
'找到 space 或 tab。
'将 InArg 标志设置成 False。
InArg = False
End If
Next I
'调整数组大小使其刚好符合参数个数。
ReDim Preserve ArgArray(NumArgs)
'将数组返回。
GetCommandLine = ArgArray()
End Function