473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Switches for My Application

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
8 1801
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
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
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
> Get them damn curly braces out of here! Heresy!

LOL
Nov 21 '05 #5
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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Richard Siderits | last post by:
Greetings. I am trying to write a small application for controlling CRYDOM AC and DC switches from the parallel port using pyparallel. The project is described in the latest issue of MAKE...
0
by: John Hardin | last post by:
All: I'm writing a application monitor class, and I'd like to be able to dump a list of all defined trace switches and their settings without knowing beforehand that they exist, or forcing the...
0
by: JD | last post by:
Hi folks, I am developing a COM-ATL application with VS2003.NET, and I run into this situation: I have built the app to a satisfactory point and after that I start playing with compiler...
2
by: Thomas Koch | last post by:
Hi there - I am developing a general library which allows programs to access our server product. I am using the System.Configuration.Trace and System.Configuration.BooleanSwitch classes for...
7
by: John Wildes | last post by:
Hello All, I've got a VB.net windows form app that I have created to solve some recurring maintenance tasks. What I would like to do is build functionality into this application so that accepts...
2
by: Paul Hatcher | last post by:
Has there been a change in behaviour of switches between 1.1 and 2.0. I have a web site that defines a switch and then an application that adds the same switch but with a different value. Under...
0
by: GoneRural | last post by:
Hello... Has anyone else have had the problem of using the Thread.Start method in VB.Net using switches in the command line? I am using VB.Net 2005 and I create a command line of the main...
2
by: Dave | last post by:
Can you create your own switches or attributes for a console app to specify specific arguments? In other words, specify a /f to represent the "from date" and /t as "to date"? if I need to supply...
6
by: =?Utf-8?B?QnJlbmRhbiBLYXk=?= | last post by:
Hi there, We have an ASP.Net application that is generating huge numbers of Context Switches when a certain number of active users are present. We tried changing the configuration of the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.