How to use command line arguments
I have a console application which reads .txt files. I want to be able to drag a txt file over my app and it would automatically open my app and show the text files contents. I think I 开发者_如何学编程have to use command line arguments like this:
Sub Main(ByVal cmdArgs() As String)
End Sub
Sub ReadFile(FilePath as String)
End Sub
But how can I pass the text files path to my ReadFile sub?
All what I had to do is read the first argument like this:
Sub Main(cmdArgs as String())
ReadFile(cmdArgs(0))
End Sub
精彩评论