CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2003
    Posts
    67

    Process.Start question

    Hi,

    I'm writing an ASP.net app using C# and i'm writing a simple code where i click a button I want the browser to open.

    Here's the code:

    Code:
    				
              
    Process test = Process.Start("C:\\DRIVERS\\AUD\\L400\\setup.exe");
    Unfortunately, when I click on the button in the webpage, the browser seems to be thinking, i get a progress bar at the bottom of the browser, but the progress bar stops in the middle.

    Can someone please help me? I know that running .exe manually works because i've tried it so it can't be the .exe that's causing the problem...

    Thanks

    Rico

  2. #2
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    how about trying Process.Start("file:///C:\\DRIVER\\....");
    You know, starting the proccess object with a file:/// or smth... like it happends in IE if you open some local file...

    Try
    Regards,
    Alexei

  3. #3
    Join Date
    Sep 2003
    Posts
    67
    Hi Alexei,

    It looks like placing the "file:///C:\\DRIVER\\...." is still causing the browser to wait for a long period of time, and then nothing happens...

  4. #4
    Join Date
    Nov 2003
    Location
    Sweden
    Posts
    129
    I might have written a bit wrong... All of the slashes must look like //, but there should be 3 of them after the file:...

    So it would be like this: file:///C://DRIVER//..

    try this.. im not sure its going to work..
    Regards,
    Alexei

  5. #5
    Join Date
    Sep 2003
    Posts
    67
    Thanks Alexei,

    But i'm still not having luck with the switched slashes..


    Rico

  6. #6
    Join Date
    Sep 2003
    Posts
    67

    Unhappy Still Stumped....

    Hi everyone,

    So what happens is if I write the code in C# console application or web applicaton:

    Process.Start ("http://www.microsoft.com");

    The code works and opens up the microsoft website.

    When I write the same code in an ASP.net using C# application, I get a server error message, saying:

    "The system cannot find the file specified"

    I've tried modifying the url to be: "http:////www.microsoft.com"

    but still no luck. I've been stumped for a couple of days.

    Can anyone please help me?

    Thanks

    Rico

  7. #7
    Andy Tacker is offline More than "Just Another Member"
    Join Date
    Jun 2001
    Location
    55°50' N 37°39' E
    Posts
    1,503
    is ASP.NET, you use...

    Response.Redirect("http://www.microsoft.com");
    If you think you CAN, you can, If you think you CAN'T, you are probably right.

    Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.

  8. #8
    Join Date
    Jul 2004
    Posts
    1

    Process.Start question

    I believe the page needs to have permissions to access the application. try placing it in the bin folder to run.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured