|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Filename from Open WithI'm building a small app that is launched by right-clicking on an XML file
and choosing "Open With...". Ugly, I know, but I can't associate .xml with my app. Anyway, once the app is launched, how can I get the full path to the XML file that was opened? I believe using Open With passes as a parameter to the opening application
the full path and filename of the document to be opened. Once you grab the file parameter as a switch from My.Application.CommandLineArgs. Once you have the string, use System.IO.Path.GetFullPath to retrieve only the path portion. Jim Wooley http://devauthority.com/blogs/jwooley/default.aspx Show quoteHide quote > I'm building a small app that is launched by right-clicking on an XML > file and choosing "Open With...". Ugly, I know, but I can't associate > .xml with my app. Anyway, once the app is launched, how can I get the > full path to the XML file that was opened? > You are right. The full path and file name are passed as the first and only
arg. Thanks very much! Show quoteHide quote "Jim Wooley" wrote: > I believe using Open With passes as a parameter to the opening application > the full path and filename of the document to be opened. Once you grab the > file parameter as a switch from My.Application.CommandLineArgs. Once you > have the string, use System.IO.Path.GetFullPath to retrieve only the path > portion. > > Jim Wooley > http://devauthority.com/blogs/jwooley/default.aspx > > > I'm building a small app that is launched by right-clicking on an XML > > file and choosing "Open With...". Ugly, I know, but I can't associate > > .xml with my app. Anyway, once the app is launched, how can I get the > > full path to the XML file that was opened? > > > > > Hello smay,
What Open with... does is... Pass the file name you have clicked as a commandline argument to your application. So what you should be looking for is how to read the commandline arguments from your application. I think in .Net + VB, this can be done pretty easily. System.Environment.GetCommandLineArgs() I think that should do the trick... but I am writing from memory, and I could be wrong. Let me know if you get anywhere Regards Cyril Gupta You can do anything with a little bit of 'magination. Show quoteHide quote > I'm building a small app that is launched by right-clicking on an XML > file and choosing "Open With...". Ugly, I know, but I can't associate > .xml with my app. Anyway, once the app is launched, how can I get the > full path to the XML file that was opened? >
Populating date into SQL
Problems with Random Numbers VB.NET and Microsoft Word problem: topic becomes read-only Launching Word 2003 in prog creates exception How to mask console password input How to query the table in a dataset? IE input box from TreeView Compiling list of items that WinForms can do, WebForms cannot vb.net and DirectX Run VB.Net Exe without installing .Net Framework |
|||||||||||||||||||||||