|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Starting a serverside Application
I try to start a process from an ASP.NET web form with the following code. It starts, i see it on the taskbar, but it doesnt
bring up any window. Process p = new Process(); p.StartInfo.FileName="c:\\windows\\system32\\calc.exe"; p.StartInfo.CreateNoWindow=false; p.StartInfo.UseShellExecute=false; p.EnableRaisingEvents=true; p.Start(); I think a possible solution is related to ASPNET user rights. Any suggestion? thanks |
|
#2
|
|||
|
|||
|
Re: reply to starting a serverside program.
Is it showing up as running in your system as a process or application? If so, could be a script problem and you are looking for a solution too far from home.
Cheers, neuralSea If you have already found the solution - which I' m sure you have why not post it? |
|
#3
|
|||
|
|||
|
Maybe a solution
Things are getting better since i start the process with API calls
instead of C# managed code. If found on MSDN instruction to run an interactive client process, it starts and brings up a window, but something very strange still happens. The window is without borders, something like transparent, closing and maximizing button arent and the title bar is displayed without any text. But the windows is, i can get its handle, and is responding. If i execute the same code outside asp.net, from a normal winform or console app everything works fine. Strange but, for the moment, working. |
|
#4
|
|||
|
|||
|
need more info
Hi Koatto,
Sounds like you have called the API correctly but haven't declared which of its properties you are using. I'd check the code for using that particular part of the abstraction layer. Does this sound like a valid area to explore? I need more information. Cheers, neuralSea |
|
#5
|
|||
|
|||
|
Thats the code starting my process :
APIWrapper.PROCESS_INFORMATION ProcessInformation = new APIWrapper.PROCESS_INFORMATION(); APIWrapper.STARTUPINFO si = new APIWrapper.STARTUPINFO(); si.cb = Marshal.SizeOf(si); si.lpReserved = null; si.lpTitle = null; si.lpDesktop = "WinSta0\\Default"; si.dwX = si.dwY = 0; si.dwXSize = si.dwYSize = 20; si.dwFlags = 1; si.wShowWindow = 5; si.lpReserved2 = 0; si.cbReserved2 = 0; APIWrapper.SECURITY_ATTRIBUTES sa = new APIWrapper.SECURITY_ATTRIBUTES(); int ret = APIWrapper.CreateProcess(null,"calc",ref sa, ref sa, false, new IntPtr(0), new IntPtr(), null, ref si, ref ProcessInformation); Process proc = Process.GetProcessById(ProcessInformation.dwProcessId); |
|
#6
|
|||
|
|||
|
message for Koatto
Hi Koatto, Apologies for the delay. Not being familiar with asp.net this is only a best guess but I think you are missing a couple of lines in initialising your properties. Since I'm not terribly au fait with the object APIWrapper.STARTUPINFO() I'd start by making sure that all things that need initialising are initialised. It probably works elsewhere because the API uses OS resources that are not immediately available to you using ASP.NET. If you have an object browser/dynamic help/etc in your IDE see if you can find the additional properties that need to be included in order for your program to work. Sorry for the simplistic answer but I've often found that therein lies the solution.
Hope this helps. Good luck! Cheers, neuralSea |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > .Net Development > Starting a serverside Application |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|