Page is a not externally linkable
mack - 1:31 am on Nov 28, 2009 (gmt 0)
If myvariable.Length = 0 Then do something End If If myvariable.Length > 0 Then do somethign else End If Next When a paramiter is sent it handles it correctly, but if no peramiter is sent it simple ignores both if statements. The calue being sent is collected and passed to a variale (dim) so the value exists, even if it has no content. By checking the variable lenghth I was hoping to be able to confirm or eny if a value had been passed. Is there somethign else I need to look into to determine if a peramiter has been passed to the exe. Does having no value passed bean that peramiter.lenghth = "0" would still not work? I can confirm the value has been sent and received. I debuged this by assigning its value to a label, it showed the correct value within the app itself. Thanks in advance. Mack.
In one of my vb.net apps I pass a value to the exe file. I use the following code to handle the paramiter received and convert it to a string within the application.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'get command peramiters
Dim CommandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Application.CommandLineArgs
For i As Integer = 0 To CommandLineArgs.Count - 1
Dim myvariable As String
myvariable = (CommandLineArgs(i))
Label1.Text = myvariable.Length 'only used for debug
End Sub