Is there a VB.NET alternative to the Command function?

LHandy

Well-known member
Joined
May 27, 2005
Messages
50
Programming Experience
5-10
[RESOLVED] Is there a VB.NET alternative to the Command function?

To get the arguments passed to the program in VB6, you would use the Command function to get them. This exists in the Microsoft.VisualBasic namespace for .NET v1.1, but .NET 2.0 BETA does not have it. (A friend of mine has 2.0 beta, not me. The question is for him.)

Is there a .NET alternative to this? Preferably 2.0 specific, but I'll take anything.
 
Last edited:
to get the commandline arguements in .net i do know of this way:

VB.NET:
Dim strStartupArguments() As String, intCount As Integer
strStartupArguments = System.Environment.GetCommandLineArgs

		For intCount = 0 To UBound(strStartupArguments)
			Select Case strStartupArguments(intCount).ToLower
				Case "arguement1"
				    'Do your code for argument1
				Case "anotherarguement"
				    'Do your code for anotherargument
			End Select
		Next intCount
 
Ah! Thanks a lot. We didn't think to look in System.Environment. You'd think it would be in Application.

Thanks again.
 
Back
Top