User441205184 posted
From a button click on ASP.Net page , an exe is downloaded to client machine using the following code
FileInfo file1 = new System.IO.FileInfo(someexe);
if (file.Exists)
{
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition", "attachment; filename=" + "SomeExe.exe");
Response.AppendHeader("Content-Length", file.Length.ToString());
Response.WriteFile(file1.FullName);
try
{
Response.Flush();
Response.SuppressContent = true;
Context.ApplicationInstance.CompleteRequest();
Response.End();
}
catch(Exception ex)
{
LogException(ex)
}
}
The exe requires further information like the user information and server url for invoking Webservice calls from it.
How can we send the required information from server to client for the for the downloaded exe to work ,rather than creating as a zip file with a config and exe ?