Re: Opening multiple files with my applicaton
- From: "JR" <xx.x.x@xxxxx>
- Date: Wed, 26 Dec 2007 07:47:47 GMT
try the following
Dim cla As String() = Environment.GetCommandLineArgs()
If cla.Length >= 1 Then
If cla.Length = 1 Then
ListBox1.Items.Add(cla(1))
else
for n as integer=2 to cla.length
ListBox1.Items.Add(cla(1) & iif(cla(1).endswith("\"),"","\") & cla(n))
next
End if
when there is more than 1 file the first item is the folder the others are the name
so check if 1 take one complete
if more take one and add the names
if the files are in the root the folder has already a backslash therefore check also with: iif(cla(1).endswith("\"),"","\")
Jan
"kimiraikkonen" <kimiraikkonen85@xxxxxxxxx> schreef in bericht news:567d287b-fd3c-493e-aa4c-9856573dc304@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have an app which has a listbox and when i double click an
associated fileS, i want their paths to be added into listbox in my
application.
This code works good when i try to open a "single" file with my app
which works to get commandline arguments to get file paths:
Dim cla As String() = Environment.GetCommandLineArgs()
If cla.Length > 1 Then
ListBox1.Items.Add(cla(1))
End if
But this doesn't work while opening more than one files at the same
time.
Assume i select 3 files with pressing CTRL + left mouse and then "open
with" my application, then i want these three files' paths must be
added as items into the listbox. (listbox will have 3 items, items are
the paths of files)
I hope you can help.
Regards.
.
- Follow-Ups:
- Re: Opening multiple files with my applicaton
- From: kimiraikkonen
- Re: Opening multiple files with my applicaton
- References:
- Opening multiple files with my applicaton
- From: kimiraikkonen
- Opening multiple files with my applicaton
- Prev by Date: datagrid
- Next by Date: Re: Opening multiple files with my applicaton
- Previous by thread: Opening multiple files with my applicaton
- Next by thread: Re: Opening multiple files with my applicaton
- Index(es):
Relevant Pages
|