stephenlecomptejr
asked on
Utilize multiple values upon starting up a VB.NET Windows application?
All,
I'm trying to change my VB.net .exe program to have more than one value passed to the program. But I get a Value of type 'String' cannot be converted to '1-dimensional array of Boolean' with line item: bOpen = returnValue(2).ToString
I understand returnValue(1) will give me the parameter when running this .exe - all I"m trying to do is have a second parameter true or false. The first parameter will be a file I want to adjust and the second parameter will tell the computer to open the file when finished but only do so if the value is true.
Thank you for any help - much appreciated.
I'm trying to change my VB.net .exe program to have more than one value passed to the program. But I get a Value of type 'String' cannot be converted to '1-dimensional array of Boolean' with line item: bOpen = returnValue(2).ToString
I understand returnValue(1) will give me the parameter when running this .exe - all I"m trying to do is have a second parameter true or false. The first parameter will be a file I want to adjust and the second parameter will tell the computer to open the file when finished but only do so if the value is true.
Thank you for any help - much appreciated.
Private Sub frmMain_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
Dim returnValue As String()
Dim bOpen As String()
returnValue = Environment.GetCommandLineArgs()
If returnValue.Length > 1 Then
txtFile.Text = returnValue(1).ToString
Try
bOpen = returnValue(2).ToString
Catch ex As Exception
End Try
btnBrowse.Visible = False
Call Start_Process(returnValue(1).ToString, True)
Else
txtFile.Text = "Q:\EC"
End If
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Open in new window