Não é mais possível fazer postagens ou usar assinaturas novas da Usenet nos Grupos do Google. O conteúdo histórico continua disponível.
Dismiss

Command Line parameter

0 visualização
Pular para a primeira mensagem não lida

A.M

não lida,
4 de nov. de 2003, 16:48:1004/11/2003
para
Hi,

Using WinForms, can i access to the command line parameters?

Thanks,
Ali


Herfried K. Wagner [MVP]

não lida,
4 de nov. de 2003, 17:03:3904/11/2003
para
* "A.M" <IHat...@sapm123.com> scripsit:

> Using WinForms, can i access to the command line parameters?

\\\
Public Sub Main(ByVal astrCmdLineArgs() As String)
Dim i As Integer
For i = 0 To astrCmdLineArgs.Length - 1
Console.WriteLine(astrCmdLineArgs(i))
Next i
End Sub
///

-- or --

\\\
Public Sub Main()
Dim i As Integer
For i = 0 To Environment.GetCommandLineArgs().Length - 1
Console.WriteLine(Environment.GetCommandLineArgs(i))
Next i
End Sub
///

In order to test the samples above, you must set the application's
startup object to 'Sub Main'. The 2nd sample code can be used at any
place inside a Windows Forms application too.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

hexathioorthooxalate

não lida,
4 de nov. de 2003, 17:36:2504/11/2003
para
Ali, if I understand your question correctly, yes.
Hexathioorthooxalate


'Code Snippet
'=============

Debug.WriteLine("EntireCommandline=" + System.Environment.CommandLine)
Dim applicationCLineArgs As String() =
System.Environment.GetCommandLineArgs()
For argCounter As Integer = 0 To applicationCLineArgs.Length - 1
Debug.WriteLine("argument " + argCounter.ToString() + "=" +
applicationCLineArgs(argCounter))
Next argCounter

'Sample Output
'================
EntireCommandline="C:\test\WindowsApplication9\bin\WindowsApplication9.exe"
commandarg1 commandarg2
argument 0=C:\test\WindowsApplication9\bin\WindowsApplication9.exe
argument 1=commandarg1
argument 2=commandarg2


"A.M" <IHat...@sapm123.com> wrote in message
news:OtnXKzxo...@TK2MSFTNGP10.phx.gbl...

0 nova mensagem