开发者

How to use command line arguments

开发者 https://www.devze.com 2023-03-30 00:04 出处:网络
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 开发者_如何学编

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

精彩评论

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