c# - Download/Open .exe file on click of link button in web form -


i have link button below:

 <asp:linkbutton id="import" runat="server" font-size="small" visible="true">import</asp:linkbutton> 

on click of link button,i want user download .exe file if not present in user's computer or open existing .exe file if present in user's computer.

i tried this:

string str = @"c:\users\documents\consoleapplication1\consoleapplication1\bin\debug\consoleapplication1.exe";     process process = new process();     process.startinfo.filename = str;     process.start(); 

this works fine in local machine .exe cannot accessed web page once hosted.i think possibly because of website security issues (correct me if wrong) doesn't allow user access .exe location.

this little bit of background info.

my question how modify user can download .exe own machine (since not being able access otherwise) , if has done once,the next time clicks on link button opens downloaded .exe ?

if want user download application(.exe) should include in web project, , link should reference file relative path.

a browser never let site run .exe file (after downloaded), clicking link, big security risk.


Comments