Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a win app working that uses Process and ProcessStartInfo to fire off a program from the dos command prompt. It works great but now I need to get it to work from an ASP.NET web page or from an ASP.NET web service and I cannot get either to work.

It looks like the process is executed but the results are not there.

 

I tried impersonating in case it was a permissions issue and it didn't help.

 

The only thing I can think of is that the process object is somehow crippled in asp.net for security reasons or something. But shouldn't I be able to get around this?

 

Function aProcess(ByVal Arg As String) As String
       Dim ps As New ProcessStartInfo
       Dim p As New Process

       Try
           ps.FileName = "cmd.exe"
           ps.Arguments = Arg
           ps.UseShellExecute = True
           p.StartInfo = ps
           p.Start()
           p.Close()

           Return "Success"
       Catch ex As Exception
           Return ex.Message
       End Try
   End Function

Wanna-Be C# Superstar
Posted

Even with impersonate on?

I thought it would run under the impersonated account? Is it not doing that because it is on another thread or something?

 

I have tried asp.net web services, and straight asp.net and no luck.

Now I am on to Windows service.

 

Does anyone know how to call a windows service and pass in parameters?

 

If I google for '.net windows service' I get the same tired sample on 6 different websites, that stinks. :(

Wanna-Be C# Superstar
Posted

1. change your Win App to a ServicedObject,

2. load it in COM services

3. give ASPNET permission to launch it

4. Rewrite your win app to call the serviced object*

5. Done

 

 

* this is optional, but it allows for a single functional unit used by your asp as well as your win.

Joe Mamma

Amendment 4: The right of the people to be secure in their persons, houses, papers, and effects, against unreasonable searches and seizures, shall not be violated, and no warrants shall issue, but upon probable cause, supported by oath or affirmation, and particularly describing the place to be searched, and the persons or things to be seized.

Amendment 9: The enumeration in the Constitution, of certain rights, shall not be construed to deny or disparage others retained by the people.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...