Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
I would like to insert this software for predicte tides http://www.wxtide32.com/download.html[^](wxtide47.zip from wxtide32)
into a folder on my website, but i dont' know
i think that here http://www.hobbypesca.com/nozioni_base/tavole_marea_e_fasi_lunari/porti_italiani/brindisi.asp[^]
and here
http://www.biggame.it/maree/maree-reggiocalabria.htm[^]
they do it
can you help me
Posted
Updated 14-Dec-15 4:19am
v2
Comments
Dave Kreskowiak 14-Dec-15 10:57am    
What what? You simply copy the file to an appropriate folder in your website folder.

Now, if you're asking how to USE that executable and do something with it, I suggest you talk to the people who wrote it.
Sinisa Hajnal 14-Dec-15 11:05am    
If you're thinking to show your users the application and run it in their computer, forget it. You might offer download, but you loose any control over the application that way. You might use it on the server and use its data as background data service and just show the results to your users...
ZurdoDev 14-Dec-15 12:13pm    
Have the comments answered your question? Both Dave and Sinisa are correct in what they have said.

1 solution

Try this code

Step 1:
<asp:LinkButton ID="LinkButton2" runat="server" onclick="LinkButton2_Click">Download PDF</asp:LinkButton>


Step 2: Create folder and place exe in that folder.........

Step 3:
C#
protected void LinkButton2_Click(object sender, EventArgs e)
        {
            //AdbeRdr910_en_US
            string path = Server.MapPath("AdbeRdr910_en_US.exe"); //get physical file path from server
            string name = Path.GetFileName(path);
            string ext = Path.GetExtension(path);
            string type = "";

            // set known types based on file extension  
            if (ext != null)
            {
                switch (ext.ToLower())
                {
                    case ".htm":
                    case ".html":
                        type = "text/HTML";
                        break;

                    case ".txt":
                        type = "text/plain";
                        break;

                    case ".GIF":
                        type = "image/GIF";
                        break;

                    case ".pdf":
                        type = "Application/pdf";
                        break;
                    case ".exe":
                        type = "Application/exe";
                        break;

                    case ".doc":
                    case ".rtf":
                        type = "Application/msword";
                        break;

                    
                }
            }

            Response.AppendHeader("content-disposition", "attachment; filename=" + name);

            if (type != "")
                Response.ContentType = type;
            Response.WriteFile(path);
            Response.End(); //give POP to user for file downlaod
        }
 
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