| | |
command line parameters part 2!
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
![]() |
•
•
Join Date: Apr 2008
Posts: 19
Reputation:
Solved Threads: 0
Hi,
I was on the forum yesterday asking for help with using command line parameters. As described I am new to vb.net programming, and I am stuck with what is probably a very simply problem.
I am trying to create a vb.net program to which I will be passed parameters from another program. As a test I am doing the very simple following code
<code>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = My.Application.CommandLineArgs(0)
End Sub
</code>
When I am running this in debug mode, with a command line parameter passed, the label shows the expected result. However whenever I try and publish the program, and install it, I get an error saying
"Index was out of range. Must be non-negative and less than the size of the collection".
I am thinking this is because I need to run it from the command line, however, i am not even sure how to do this! In the folder where the setup.exe exists there is a windowsApplication1 application manifest, but I cant find the .exe.
Please can anyone help with this??? It has been driving me crazy!
Kindest regards,
David.
I was on the forum yesterday asking for help with using command line parameters. As described I am new to vb.net programming, and I am stuck with what is probably a very simply problem.
I am trying to create a vb.net program to which I will be passed parameters from another program. As a test I am doing the very simple following code
<code>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Text = My.Application.CommandLineArgs(0)
End Sub
</code>
When I am running this in debug mode, with a command line parameter passed, the label shows the expected result. However whenever I try and publish the program, and install it, I get an error saying
"Index was out of range. Must be non-negative and less than the size of the collection".
I am thinking this is because I need to run it from the command line, however, i am not even sure how to do this! In the folder where the setup.exe exists there is a windowsApplication1 application manifest, but I cant find the .exe.
Please can anyone help with this??? It has been driving me crazy!
Kindest regards,
David.
When you clicked "Publish Now" under the Publish tab it builds all the files, including one called something like "windowsApplication1.exe.deploy". This is the exe file but VB.NET has added the .deploy to the file name
You can remove the .deploy yourself or get VB.NET to do it for you by:
When in the Publish tab click Options and untick "Use .deploy file extension" then click "Publish Now"
You can remove the .deploy yourself or get VB.NET to do it for you by:
When in the Publish tab click Options and untick "Use .deploy file extension" then click "Publish Now"
![]() |
Similar Threads
- Differences Between Java and C/C++ (C++)
- file types and main arguments (C)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- Assignment problem c in Linux (Community Introductions)
- Help me in Round Robin Algorithem& Shortest remaining time next (C)
- Shell Scripting problem and related awk issues (Shell Scripting)
- not-a-virusadware (Viruses, Spyware and other Nasties)
- Using command line parameters (C++)
- Round Robin algorithm? (Java)
- Tutorials for Linux (*nix Software)
Other Threads in the VB.NET Forum
- Previous Thread: RDF Parser
- Next Thread: Button click to text
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2008 access add application arithmetic array assignment basic beginner box button buttons click code combo component connectionstring convert cpu cuesent data database databasesearch datagrid datagridview datetimepicker design designer dissertation dissertations dissertationthesis dosconsolevb.net editvb.net exists firewall folder forms html image images isnumericfuntioncall listview math mobile module mssqlbackend mysql navigate number opacity open peertopeervideostreaming picturebox1 picturebox2 port print printpreview problemwithinstallation project record regex reports" reuse right-to-left savedialog serial settings socket sqldatbase sqlserver storedprocedure string temp textbox timer txttoxmlconverter updown useraccounts usercontol usercontrol vb vb.net vb.netcode vb.nettoolboxvisualbasic2008sidebar vbnet view vista visual visualbasic visualbasic.net visualstudio visualstudio.net web wpf wrapingcode xml





