DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: How to run an exe when client click on button

  1. #1
    Join Date
    Dec 2007
    Posts
    28

    Unhappy How to run an exe when client click on button

    I am sending input parameters to VB6.0 application from asp.net webpage using useshellexecute.

    The VB application is receivng the inputs and processing it(e.g adding two variables) when i am executing the ASP project from my local host

    But when the user opens the page and click on button the exe is not getting executed

    How Can I execute the application when the user clicks on the page from his local PC?



    below is my asp.net code which will send the parameters to the VB6.0 application

    If IsPostBack Then
    p.UseShellExecute = true
    p.Arguments = Val(TextBox1.Text) & " " & Val(TextBox2.Text)

    p.FileName = "C:\Inetpub\wwwroot\ASPAPPLICATION1\addvar.exe"
    System.Diagnostics.Process.Start(p)
    p.WindowStyle = Diagnostics.ProcessWindowStyle.Maximized
    end if



    below is the VB code

    args = Split(Command$, " ")

    Text1.Text = args(0)
    Text2.Text = args(1)
    Text3.Text = Val(Text1.Text) * Val(Text2.Text)

    Thankks in advance

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    All ASP.NET code runs on the server. When you run the app on your localhost, you're sitting at the server and can see the VB program run. When another user visits the page from his own PC, the VB program still runs, but it does on the server so the user can't see it. There's no way to launch an executable on the client PC from ASP.NET server-side code.

    Why are you trying to do this? Surely there are simpler ways to add two numbers together.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Dec 2007
    Posts
    28

    Running exe when user clicks a button

    Hi Phil,

    I need the Output from the VB exe back to the ASP page.

    Currently i am writing the output from VB exe to a file and reading the content of the file from ASP application.

    If the exe is running defenetly the content in the file should change.But its not happening

    Whether the process will start if the user clicks on the button from his page as per the code written by me?

    This is just a sample program

  4. #4
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    Yes, the process should run on the server whether you click the button on the localhost or the user clicks the button on his PC. It sounds like a permissions issue; perhaps the ASPNET worker process does not have permission to write to the file. Are there any error in the Application or System event logs on the server?

    Have you considered simply putting the desired functionality in the ASP.NET app rather than shelling a VB6 application?
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  5. #5
    Join Date
    Dec 2007
    Posts
    28
    I need to have an independant application running outside asp.net environment.Thats why this set up.

    So i should be able to run the code with the existing code,right?

    Modify permission is given to the user.
    Is there any command which we need to use when postback operation occurs from a user PC?

Similar Threads

  1. Replies: 8
    Last Post: 05-23-2007, 12:31 PM
  2. Get cell value on click of link button
    By Rathi in forum ASP.NET
    Replies: 1
    Last Post: 06-05-2006, 04:46 AM
  3. Getting a GUI to run
    By Eric in forum Java
    Replies: 4
    Last Post: 04-14-2006, 09:09 AM
  4. Linking a button click to a mouse event?
    By fulcanelli in forum Java
    Replies: 10
    Last Post: 11-06-2005, 03:29 PM
  5. Replies: 0
    Last Post: 04-23-2001, 11:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center