views:

53

answers:

2

I have the exe file of micromedia flash player. I am able to run this file from the .net application by using the following code

private void button1_Click(object sender, EventArgs e)
        {
            System.Diagnostics.Process.Start("peopledisplay.exe");
            //System.Diagnostics.Process.Start("iexplorer.exe", "peopledisplay.exe");

        }

This code launches the micromedia flash file after clicking the button. I want this file to be launched in the internet explore after clicking the button. How to do this ? Can you please provide me any code or link through which I can resolve the above issue ?

A: 

What you do in this code is tell the server to open the executable, not the browser client. You'd need some JavaScript like the following, but that will probably only work in Internet Explorer, and only if the user explicitly sets the permissions in the IE options window.

<script>
     function go() {
       w = new ActiveXObject("WScript.Shell");
       w.run('peopledisplay.exe');
       return true;
       }

     </script>

     <form>
       Run Notepad (Window with explorer only)
         <input type="button" value="Go" 
         onClick="return go()">
    </form> 
Joachim VR
I am new to the .net framework. I am working on windows application. can you please tell me where should I write this code. Please tell step by step.
Shailesh Jaiswal
@Shailesh - you have already marked it as the answer, so you may have to unmark it. This answer is script that runs in a web page so it won't work in your winforms application.
slugster
I'm sorry, I was thinking ASP.NET with the Internet Explorer and all. A flash compiled exe can't be run from the browser, it's an executable. You should (if you can) acquire the .SWF file, and run that through the browser in the way Slugster told you.
Joachim VR
A: 

Try this:

System.Diagnostics.Process.Start(@"\"C:\Program Files (x86)\Internet Explorer\iexplore.exe\" \"[path to my file]\"");

you need to specify the path to the flash file on the command line to IE. Make sure you enclose the path with quotes. Of course this is no guarantee that IE will actually be able to run the file, you may find that security restrictions (zone rules, group policy) prevent that.

slugster