|
-
Feb 15th, 2009, 04:11 PM
#1
[RESOLVED] [2008] Copy file to local machine and allow it to open
We have an app that tracks .DOC and .PDF files (and possibly other file extensions). It stores copies of them on a network share.
I want to give the ability to the user to allow them to click the file in a listview, for example, and have that file open in WORD or ADOBE or whatever program is associated with that file type.
How would I go about this?
And how about allowing them to click a "hyperlink" in some textbox, for instance, and have that open in IE?
-
Feb 15th, 2009, 04:27 PM
#2
Re: [2008] Copy file to local machine and allow it to open
Use the appropriate event from the ListView to work out which file was clicked and you can open a file of whatever type using;
Code:
System.Diagnostics.Process.Start(FileName)
Instead of specifying a FileName above, this field can also be a web link. You should not force IE, since that may not be the users preferred browser. If you start a process as above with a URL present, it will open the users default browser.
If you want to display some links, a LinkLabel would be better than a TextBox.
Last edited by Bulldog; Feb 15th, 2009 at 04:33 PM.
-
Feb 15th, 2009, 04:36 PM
#3
Re: [2008] Copy file to local machine and allow it to open
That worked great so far - thanks!
-
Feb 15th, 2009, 04:38 PM
#4
Re: [2008] Copy file to local machine and allow it to open
 Originally Posted by Bulldog
If you want to display some links, a LinkLabel would be better than a TextBox.
They are textboxes right now because they are bound to dataadapters for maintenance. They don't want "click" to cause them to open - they haven't really told me what key press they prefer yet
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|