Run App from document file

  • Thread starter Thread starter Elik
  • Start date Start date
E

Elik

how can i run an application by clicking the document file
attached to, like doc file. clicking doc file run Word,
How can i attached a file prefix to a given app.
Thanks
 
A quick way to do it is let System.Diagnostics.Process handle it.
The code below opens wmsetup.log using the default text editor,
notepad.exe

Process.Start(@"C:\WINNT\wmsetup.log");

Cheers!
-
/jop
 
thamnks
but that from code, how to make it work when i click the
file with the mouse? like office document
 
Elik said:
thamnks
but that from code, how to make it work when i click the
file with the mouse? like office document

How would you go about clicking the file with the mouse?

And, do you want this program to run on the client, or on the server?
 
I might have misunderstood your original question...
It seems you are asking about how to create a file association...

An MSDN search reveals the concept of associating an application
to a file class/extension (search on "Creating a File Association")
http://msdn.microsoft.com/library/d...sics_extending/fileassociations/fileassoc.asp

Basically, you just create registry entries for the file types that you want
associated with your application.

If you have setup project for your application, you can easily associate
a file through the File Types editor.

Finally, if you are in a haste, there is a File Association class in
mentalis.org
that you can reuse... http://www.mentalis.org/soft/classes.qpx

Does this answer your question?

Cheers!
 
Back
Top