Skip to main content

Posts

Showing posts from November, 2015

How to run .EXE on button click in Asp.net(C#)

This code will show you how to run a executable file(.exe) on a button click.With this code you can run all .exe file on your Webpage. // Create a Process Object here.  System.Diagnostics.Process process1 = new System.Diagnostics.Process(); //Working Directory Of .exe File.  process1.StartInfo.WorkingDirectory = Request.MapPath("~/"); //exe File Name.  process1.StartInfo.FileName = Request.MapPath("abc.exe"); //Argement Which you have tp pass.  process1.StartInfo.Arguments = " "; process1.StartInfo.LoadUserProfile = true;  //Process Start on exe. process1.Start(); process1.WaitForExit(); process1.Close();

Convert Div Content To Image Using JavaScript in ASP.NET(C#).

INDEX.ASPX <html> <head runat="server"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript" src="http://cdn.rawgit.com/niklasvh/html2canvas/master/dist/html2canvas.min.js"></script> <script type="text/javascript"> function ConvertToImage(btnExport) {     debugger;     html2canvas($("#dvTable")[0]).then(function(canvas)     {         debugger;         var base64 = canvas.toDataURL();         $("[id*=hfImageData]").val(base64);         debugger;         __doPostBack(btnExport.name, "");     });     return false; } </script> </head> <body> <form id="form1" runat="server"> <asp:HiddenField ID="hfImageData" runat="server" ClientIDMode="Static"