J
Justin F
I have set up file association for my application (VB.Net). I'm having
problems getting the filename that was double-clicked. On my machine at
work, if the filename being passed in to the application has spaces in any
of the folder names, they get split up at every space. This happens
regardless if I use a Sub Main(ByVal args() as String) or use
System.Environment.GetCommandLineArgs(). For example, if I launch a file
that's on my desktop, the string array is something like this (I am not able
to open the file unless I were to append args together to make a complete
path\filename, which doesn't seem too safe to me):
args(0) = C:\Documents
args(1) = and
args(2) = Settings\MyUsername\Desktop\MyFile.sql
If I run the same application on my computer at home, args looks like this
(I am able to open the file):
args(0) = C:\Docume~1\MyUser~1\Desktop\MyFile.sql
My question is twofold. Why does this act differently on two machines both
running WinXP Pro SP2? And what is the "right" way to get the complete
path\filename?
Thanks,
Justin
problems getting the filename that was double-clicked. On my machine at
work, if the filename being passed in to the application has spaces in any
of the folder names, they get split up at every space. This happens
regardless if I use a Sub Main(ByVal args() as String) or use
System.Environment.GetCommandLineArgs(). For example, if I launch a file
that's on my desktop, the string array is something like this (I am not able
to open the file unless I were to append args together to make a complete
path\filename, which doesn't seem too safe to me):
args(0) = C:\Documents
args(1) = and
args(2) = Settings\MyUsername\Desktop\MyFile.sql
If I run the same application on my computer at home, args looks like this
(I am able to open the file):
args(0) = C:\Docume~1\MyUser~1\Desktop\MyFile.sql
My question is twofold. Why does this act differently on two machines both
running WinXP Pro SP2? And what is the "right" way to get the complete
path\filename?
Thanks,
Justin