开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜