command line parameters part 2!

Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Thread Solved
Reply

Join Date: Apr 2008
Posts: 19
Reputation: mcgarry101 is an unknown quantity at this point 
Solved Threads: 0
mcgarry101 mcgarry101 is offline Offline
Newbie Poster

command line parameters part 2!

 
0
  #1
Apr 23rd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 169
Reputation: ptaylor965 is an unknown quantity at this point 
Solved Threads: 19
Sponsor
ptaylor965's Avatar
ptaylor965 ptaylor965 is offline Offline
Junior Poster

Re: command line parameters part 2!

 
0
  #2
Apr 23rd, 2008
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"
Peter Taylor
Visual Basic.NET Application Developer

TaylorsNet
http://www.taylorsnet.co.uk
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 19
Reputation: mcgarry101 is an unknown quantity at this point 
Solved Threads: 0
mcgarry101 mcgarry101 is offline Offline
Newbie Poster

Re: command line parameters part 2!

 
0
  #3
Apr 28th, 2008
thanks a lot that helped a lot!

David.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC