CinoV

In file association my program only can handle just one file per instant (it will create another instant if I click 2 or more files together). How do I make my program to handle 2 or more files in one instant. Here r my code:

Code Snippet

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Command$() <> Nothing Then

Dim A As String = Command$()

Dim sr As New StreamReader(A)

TextBox1.Text = sr.ReadToEnd

sr.Close()

End If



Re: Visual Basic Language File handle in File Association

spotty

Command$ returns and array of strings provided as command line parameters.

iterate around this collections and append each file to the textbox text property

Code Snippet

If Command$() <> Nothing Then

for each A as string in Command$()

Dim sr As New StreamReader(A)

TextBox1.Text = TextBox1.Text & sr.ReadToEnd

sr.Close()

next
end if






Re: Visual Basic Language File handle in File Association

CinoV

Thanks for the fast reply Spotty,

I have try the above code but still can't get it work, I still got 2 instants instead of 1.

I even try to make my program to only allow single instant (by changing the App properties), I got only 1 file come out although I click 2 files.

Any idea