By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

Switches for My Application

P: n/a
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command
line switch.

I cannot find anyway to do that in Visual Studio .net 2003
Nov 21 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
This will accept the command line args.

Sub Main(CmdArgs() as String)
debug.writeline(CmbArgs(0))
end sub
"Atley" <at*****@homtmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command
line switch.

I cannot find anyway to do that in Visual Studio .net 2003

Nov 21 '05 #2

P: n/a
Main() method can accept parameters. For example:

Public Shared Sub Main (args() As String)
{
// args(0) 1st arg; args(1) 2nd arg; etc.
}
"Atley" <at*****@homtmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command
line switch.

I cannot find anyway to do that in Visual Studio .net 2003

Nov 21 '05 #3

P: n/a
Get them damn curly braces out of here! Heresy!

;-)

Chris

"Shiva" <sh******@online.excite.com> wrote in message
news:eB**************@TK2MSFTNGP14.phx.gbl...
Main() method can accept parameters. For example:

Public Shared Sub Main (args() As String)
{
// args(0) 1st arg; args(1) 2nd arg; etc.
}
"Atley" <at*****@homtmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command
line switch.

I cannot find anyway to do that in Visual Studio .net 2003

Nov 21 '05 #4

P: n/a
> Get them damn curly braces out of here! Heresy!

LOL
Nov 21 '05 #5

P: n/a
if i use your method... and tell my application to use

MyAppPathUsed = CurrentApp.AppPath & " " & OperatorID

Dim ProcID as New Process
ProcID.Start (MyAppPathUsed)

to start the application, I get File Not Found Errors
I am getting the application paths from a SQL database, so I have to start
the application dynamically depending on which application they choose.
Can you tell me how I can dynamically add the switch to my application path
in code and start it.
"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:uV**************@TK2MSFTNGP12.phx.gbl...
This will accept the command line args.

Sub Main(CmdArgs() as String)
debug.writeline(CmbArgs(0))
end sub
"Atley" <at*****@homtmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command line switch.

I cannot find anyway to do that in Visual Studio .net 2003


Nov 21 '05 #6

P: n/a
Sorry about that! :-(

Here is the correct code, btw:

Public Shared Sub Main (args() As String)
'args(0) 1st arg; args(1) 2nd arg; etc.
End Sub

(Thats what happens when you think in C# and code in VB.NET! :-) )

"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com> wrote
in message news:O5**************@TK2MSFTNGP11.phx.gbl...
Get them damn curly braces out of here! Heresy!

;-)

Chris

"Shiva" <sh******@online.excite.com> wrote in message
news:eB**************@TK2MSFTNGP14.phx.gbl...
Main() method can accept parameters. For example:

Public Shared Sub Main (args() As String)
{
// args(0) 1st arg; args(1) 2nd arg; etc.
}
"Atley" <at*****@homtmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command
line switch.

I cannot find anyway to do that in Visual Studio .net 2003


Nov 21 '05 #7

P: n/a
Take a look at the startprocessinfo class (Process.StartInfo property).
There are several examples in there. or you can use the overloaded method
of Process.Start

//Not Tested
dim MyAppPathUsed as String
Dim OperatorID as String = "1"

MyAppPathUsed = CurrentApp.AppPath

Dim ProcID as New Process
ProcID.Start (MyAppPathUsed, OperatorID)

Hope it helps.

"Atley" <at*****@homtmail.com> wrote in message
news:ep****************@TK2MSFTNGP12.phx.gbl...
if i use your method... and tell my application to use

MyAppPathUsed = CurrentApp.AppPath & " " & OperatorID

Dim ProcID as New Process
ProcID.Start (MyAppPathUsed)

to start the application, I get File Not Found Errors
I am getting the application paths from a SQL database, so I have to start
the application dynamically depending on which application they choose.
Can you tell me how I can dynamically add the switch to my application
path
in code and start it.
"Chris, Master of All Things Insignificant" <chris@No_Spam_Please.com>
wrote
in message news:uV**************@TK2MSFTNGP12.phx.gbl...
This will accept the command line args.

Sub Main(CmdArgs() as String)
debug.writeline(CmbArgs(0))
end sub
"Atley" <at*****@homtmail.com> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...
>I want to be able to pass information to my application viw Command Line
> Switches.
>
> I want to be able to pass an operator ID to my application from a command > line switch.
>
> I cannot find anyway to do that in Visual Studio .net 2003
>
>



Nov 21 '05 #8

P: n/a
"Atley" <at*****@homtmail.com> schrieb:
I want to be able to pass information to my application viw Command Line
Switches.

I want to be able to pass an operator ID to my application from a command
line switch.


\\\
Public Module Program
Public Sub Main(ByVal Args() As String)
If Args.Length > 0 Then

' 'Args' is a string array that contains the command line
' parameters' values.
End If
End Sub
End Module
///

In the project properties, select 'Sub Main' as startup object.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.