Re: My.Application.CommandLineArgs
- From: "Anders B" <anders@xxxxxxxxxxx>
- Date: Fri, 16 Feb 2007 12:45:44 +0100
Hello,
Ok, I made my app make a log of it.. and this is what it gets when I select 6 files. (wrote every CommandLineArg followed by a vbCrLf just so I could read the log easier..)
D:\tmp\test - Copy (4) - Copy.txt
D:\tmp\test - Copy (6).txt
D:\tmp\test - Copy - Copy (4).txt
D:\tmp\test - Copy (5) - Copy.txt
D:\tmp\test - Copy (5).txt
D:\tmp\test - Copy - Copy (3).txt
If I select more then 6 files it wont do anything to the log.. because as I said.. it wont start the application... no runtime or anything..
Hold on an I'll go over to my XP machine and run the program.
Oh yeah, this is weird. I run the exact same program in the exact same way (through the sendto menu) and I just tried 38 files and it listed them all in the log file..
So its not the limitation of ComandLineArgs.. has to be some sort of compatibility issue with VS 2005 and Vista? hmm..
Thoughts?
"Stephany Young" <noone@localhost> wrote in message news:e6KpcWbUHHA.4252@xxxxxxxxxxxxxxxxxxxxxxx
If you are providing the commandline args via the SendTo mechanism then you obviously can't test this in the IDE.
I suggest you dump the input out to a file and see what you ACTUALLY have.
Something like:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim _ss As String = String.Empty
For Each _s As String In My.Application.CommandLineArgs
If _ss.Length > 0 The _ss &= " "
_ss &= _s
Next
Dim _sw As New IO.StreamWriter("xxx.log")
_sw.WriteLine(_ss)
_sw.Close
End Sub
Then post what you have in xxx.log here.
"Anders B" <anders@xxxxxxxxxxx> wrote in message news:ODvPJrZUHHA.3316@xxxxxxxxxxxxxxxxxxxxxxxOk, a bit of background. I am using my application on the "Send to" menu that you find when right clicking on a file in Explorer. And im picking up the selected files with the CommandLineArgs. And its working.. but as I said it will only give me the path of 6 files under Vista and when I tried on an XP machine I tried up to 10 files.. will see if I can do more.
For a test I've copied a bunch of text files that im selecting and sending to my app through the send to menu.
And right now im not doing much with the arguments in my application simply displaying them in a messagebox.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
Dim s As String
For i = 0 To My.Application.CommandLineArgs.Count - 1
s = My.Application.CommandLineArgs.Item(i)
MsgBox(s)
Next
End Sub
"Stephany Young" <noone@localhost> wrote in message news:O$IA5WZUHHA.3652@xxxxxxxxxxxxxxxxxxxxxxxIt's not limited to 6 on Vista by any means.
Working quite happily with 23 on
Windows 2000 Server
Windows 2000 Workstation
Windows XP
Windows 2003 Server
Windows Vista
Perhaps yuo might like to post the command line you are using because I'm sure that the problem is likely to be one or more of the characters in the string.
"Anders B" <anders@xxxxxxxxxxx> wrote in message news:OBsHuRZUHHA.4260@xxxxxxxxxxxxxxxxxxxxxxxThat really got me thinking..
And since I am trying Vista right now I thought, perhaps the problem lies there..
So I tried my app on an XP box and that worked like a charm.. tried 10 arguments.
Got any clue on what it might be that limits it to 6 under Vista? Hmm.
Developing under 2005 with service pack 1.
"Patrick Steele" <patrick@xxxxxxxx> wrote in message news:MPG.203efb2818e8b797989708@xxxxxxxxxxxxxxxxxxxxxxxIn article <e#tJpHGUHHA.3500@xxxxxxxxxxxxxxxxxxxx>, anders@xxxxxxxxxxxx
says...Hmm, can "My.Application.CommandLineArgs" only contain 6 items?
I can't seem to get anything more out of it atleast.
I just tested it with 9 and it worked.
--
Patrick Steele
http://weblogs.asp.net/psteele
.
- Follow-Ups:
- Re: My.Application.CommandLineArgs
- From: Stephany Young
- Re: My.Application.CommandLineArgs
- References:
- My.Application.CommandLineArgs
- From: Anders B
- Re: My.Application.CommandLineArgs
- From: Patrick Steele
- Re: My.Application.CommandLineArgs
- From: Anders B
- Re: My.Application.CommandLineArgs
- From: Stephany Young
- Re: My.Application.CommandLineArgs
- From: Anders B
- Re: My.Application.CommandLineArgs
- From: Stephany Young
- My.Application.CommandLineArgs
- Prev by Date: Re: As VB index help
- Next by Date: Re: My.Application.CommandLineArgs
- Previous by thread: Re: My.Application.CommandLineArgs
- Next by thread: Re: My.Application.CommandLineArgs
- Index(es):
Relevant Pages
|