| | |
command line parameters part 2!
Please support our VB.NET advertiser: Intel Parallel Studio Home
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 |
.net .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms ftp generatetags html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





