•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 423,304 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 5,339 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser: Programming Forums
Views: 1827 | Replies: 2 | Solved
![]() |
•
•
Join Date: Apr 2008
Posts: 14
Reputation:
Rep Power: 1
Solved Threads: 0
Hi,
I am fairly new to VB.NET and i'm just wondering if anyone can help with a problem I am having. I am looking to pass some parameters to a vb.net application fwhen I call the app from another program (written in oracle forms). My question relates to how these parameters should be handled.
In my form_load I have a test to see if anything is passed in -
<code>strBalType = My.Application.CommandLineArgs(0) </code>.
My other question is how is this app then called? For example from my command line can I just call c:\test.exe 10, and the string above will have a value of ten? I have tried testing this but I always get an index out of range exception.
Also is there a way, when debugging, I can run the project with these command line parameters being passed in from the IDE? This would save me having to build the project every time.
Hopefully someone can help with this because it has been dricing me crazy!
David.
I am fairly new to VB.NET and i'm just wondering if anyone can help with a problem I am having. I am looking to pass some parameters to a vb.net application fwhen I call the app from another program (written in oracle forms). My question relates to how these parameters should be handled.
In my form_load I have a test to see if anything is passed in -
<code>strBalType = My.Application.CommandLineArgs(0) </code>.
My other question is how is this app then called? For example from my command line can I just call c:\test.exe 10, and the string above will have a value of ten? I have tried testing this but I always get an index out of range exception.
Also is there a way, when debugging, I can run the project with these command line parameters being passed in from the IDE? This would save me having to build the project every time.
Hopefully someone can help with this because it has been dricing me crazy!
David.
•
•
Join Date: Feb 2008
Posts: 52
Reputation:
Rep Power: 1
Solved Threads: 6
•
•
•
•
In my form_load I have a test to see if anything is passed in -
<code>strBalType = My.Application.CommandLineArgs(0) </code>.
My other question is how is this app then called? For example from my command line can I just call c:\test.exe 10, and the string above will have a value of ten? I have tried testing this but I always get an index out of range exception.
This should work. I would place it in a test to make sure you are properly passing the arg, such as:
visualbasic Syntax (Toggle Plain Text)
If My.Application.CommandLineArgs.Count > 0 Then MessageBox.Show(My.Application.CommandLineArgs(0)) Else MessageBox.Show("No args") End If
•
•
•
•
Also is there a way, when debugging, I can run the project with these command line parameters being passed in from the IDE? This would save me having to build the project every time.
Click on My Project in the Solution Explorer, click on the Debug tab and enter the command line arguments in the Command line arguments field.
![]() |
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- command line string swap (C)
- Exe with inline parameters (Visual Basic 4 / 5 / 6)
- Preprocessor definitions on the command line (C++)
- command line arguments help (C)
- bash:redirecting stdin to at command (Shell Scripting)
- Windows Main and Command Line Parameters (C)
- Using command line parameters (C++)
- Error Linking KeyLogger.exe (C++)
Other Threads in the VB.NET Forum
- Previous Thread: VB .NET flash
- Next Thread: insert checkbox list


Linear Mode