Click here to Skip to main content
15,887,989 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Dear Sir

Please Help Me

how we can open any file like .doc, .txt, .pdf and image also when click on button using c#. That files are store in file and these path are store in sql table
Posted
Updated 2-Dec-15 5:01am
v2
Comments
CHill60 2-Dec-15 10:40am    
What have you tried?
BillWoodruff 2-Dec-15 11:20am    
When you say "open any file" do you mean start the application that handles files of that Type, or do you mean open in the sense of reading the data/bytes in the file ?

1 solution

Try:
C#
string file = @"D:\Temp\MyFile.pdf";
Process.Start(file);
The system will use whatever app is registered to handle the document type on the client PC to try and open it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900