什么意思?是在程序运行时给参数,还是在VB里读参数??
在VB里读参数读Command$就可以。
运行时传参数……不用说了吧。

解决方案 »

  1.   

    调用Command函数后返回参数字符串,处理返回字符串即可
      

  2.   

    我是说 EXE 已经编译好了,在运行时 我要给它一个参数,(如:"c:\Temp\123.txt")我在做 OCX 和 DLL 时都可以传递!!!谢谢
      

  3.   

    Function GetCommandLine(Optional MaxArgs)
       Dim C, CmdLine, CmdLnLen, InArg, I, NumArgs
       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)
          If (C <> " " And C <> vbTab) Then
             If Not InArg Then
                If NumArgs = MaxArgs Then Exit For
                   NumArgs = NumArgs + 1
                   InArg = True
                End If
             ArgArray(NumArgs) = ArgArray(NumArgs) & C
          Else
             InArg = False
          End If
       Next I
       ReDim Preserve ArgArray(NumArgs)
       GetCommandLine = ArgArray()
    End Function