Saturday, 10 December 2011

OPEN File From Server




OPEN Text,PDF,Image,Audio,Video Files From Server


In my Previous Post you get to know how to delete file from Server 
Some time situations come where you need to save file like txt,pdf,audio,video etc etc...
Now If Your PC have the software media to open it
like NOTEPAD for txt file,ADOBE for pdf,VLC for audio/video you can easily open all your file from server to your PC.








Just Follow Below Steps to Execute any file And Lets The file Automaticly open on your PC!


1)add this line in your namespace
using System.Diagnostics;


2)add this line in any event or pageload




//below line is use to open the file
 System.Diagnostics.Process.Start(Server.MapPath("TextFile.txt"));

No comments:

Post a Comment

Print Only Grid View in ASP.net

ASP.net How to Print Only GridView < div id ="gridviewDiv" >   < asp:GridView ID ="gridViewToPri...