Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how can i add .exe file in asp.net 1.1

how can i add .exe file in asp.net 1.1

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelpquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nabeelkhan
    wrote on last edited by
    #1

    hi all i have a problem in my asp.net page i want to add .exe file in my aspx page,this .exe file can convert the english date into Arabic date and this conversion application is a desktop application,now we i want to embed this application in my asp.net.how can i get the solution of my problem. best regards

    K L 2 Replies Last reply
    0
    • N nabeelkhan

      hi all i have a problem in my asp.net page i want to add .exe file in my aspx page,this .exe file can convert the english date into Arabic date and this conversion application is a desktop application,now we i want to embed this application in my asp.net.how can i get the solution of my problem. best regards

      K Offline
      K Offline
      ketankumar
      wrote on last edited by
      #2

      First of all, you cannot include an exe, but ofcourse you can execute.
      You can pass your asp.net page variables as arguments to exe, also you can get return data from exe by writing it to some text file. Here is simple code snippet in C#:

      try
      {
      string yourArgs = "bla bla bla"; //This is the input parameter to exe System.Diagnostics.Process p = new System.Diagnostics.Process();
      p.StartInfo.FileName = System.Web.HttpContext.Current.Server.MapPath("yourapplication.exe");
      p.StartInfo.UseShellExecute = false;
      p.StartInfo.WorkingDirectory = Path;
      p.StartInfo.RedirectStandardOutput = true;
      p.StartInfo.CreateNoWindow = true;
      p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
      p.StartInfo.Arguments = yourArgs;
      p.EnableRaisingEvents = true;
      p.Start();
      p.WaitForExit();
      p.Close();
      p.Dispose();
      }
      catch (Exception exp)
      {
      //Write Code to handle exception here.
      }

      Regards, Ketan.

      N 1 Reply Last reply
      0
      • K ketankumar

        First of all, you cannot include an exe, but ofcourse you can execute.
        You can pass your asp.net page variables as arguments to exe, also you can get return data from exe by writing it to some text file. Here is simple code snippet in C#:

        try
        {
        string yourArgs = "bla bla bla"; //This is the input parameter to exe System.Diagnostics.Process p = new System.Diagnostics.Process();
        p.StartInfo.FileName = System.Web.HttpContext.Current.Server.MapPath("yourapplication.exe");
        p.StartInfo.UseShellExecute = false;
        p.StartInfo.WorkingDirectory = Path;
        p.StartInfo.RedirectStandardOutput = true;
        p.StartInfo.CreateNoWindow = true;
        p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
        p.StartInfo.Arguments = yourArgs;
        p.EnableRaisingEvents = true;
        p.Start();
        p.WaitForExit();
        p.Close();
        p.Dispose();
        }
        catch (Exception exp)
        {
        //Write Code to handle exception here.
        }

        Regards, Ketan.

        N Offline
        N Offline
        nabeelkhan
        wrote on last edited by
        #3

        thnks but kindly if u give me some vb.net code snippet to execute the .exe form my asp.net applicion,it would be very healthy for me ... one more thing is that Can i give the path of my Install desktop application. would you like u tell me that running .exe from this way will not harmfull from the application. thnks bestRegards

        K 1 Reply Last reply
        0
        • N nabeelkhan

          thnks but kindly if u give me some vb.net code snippet to execute the .exe form my asp.net applicion,it would be very healthy for me ... one more thing is that Can i give the path of my Install desktop application. would you like u tell me that running .exe from this way will not harmfull from the application. thnks bestRegards

          K Offline
          K Offline
          ketankumar
          wrote on last edited by
          #4

          Hey, its not a big deal to convert this simple c# code to vb.net. Although, you can google for c# to vb.net converters and get the code converted. You can mention your dekstop application path whatever it is.

          nabeelkhan wrote:

          would you like u tell me that running .exe from this way will not harmfull from the application. thnks

          I think you are a new player thats why asking such questions. X|

          Regards, Ketan.

          N 1 Reply Last reply
          0
          • K ketankumar

            Hey, its not a big deal to convert this simple c# code to vb.net. Although, you can google for c# to vb.net converters and get the code converted. You can mention your dekstop application path whatever it is.

            nabeelkhan wrote:

            would you like u tell me that running .exe from this way will not harmfull from the application. thnks

            I think you are a new player thats why asking such questions. X|

            Regards, Ketan.

            N Offline
            N Offline
            nabeelkhan
            wrote on last edited by
            #5

            thnks ketan, i will try and let u know BestRegards nab

            1 Reply Last reply
            0
            • N nabeelkhan

              hi all i have a problem in my asp.net page i want to add .exe file in my aspx page,this .exe file can convert the english date into Arabic date and this conversion application is a desktop application,now we i want to embed this application in my asp.net.how can i get the solution of my problem. best regards

              L Offline
              L Offline
              l0kke
              wrote on last edited by
              #6

              I'm not going to answer your question, but maybe you will find my post usefull anyway :) I realy wonder, why you want to execute desktop application from web application (that is quite weird) to convert dates from one calender to another, if .NET can do it for you as well. Check good example here on codeproject: http://www.codeproject.com/cs/samples/hijrigregorianclass.asp I hope it helps, it is much better solution for your problem, I think. Pilo

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups