process.start in .NET class library

I have a strong named .NET class library project in the GAC which is being called as an exit and am trying to execute a process.start command as follows:

EventLog.WriteEntry("Inventory PDR", "Before New Process.Start")
Process.Start("IExplore.exe", "http://server/Inventory/add_pages/Preliminary_Delivery_Approval.aspx")
EventLog.WriteEntry("Inventory PDR", "After New Process.Start")

While the eventlogs execute, the process.start refuses to run and open a new process. I have tested this from the RUN command and as expected it works fine (i.e. the page is valid etc.)

Though I have a iexplorer window already open - this does not open at the desired page either if that is what it is supposed to do.

Can someone please tell me if I can do this from a .NET class library project (I haven't found anywhere that says you can't), and if not what do I do to fix it so it does...

Many thanks in advance
regards
Sean

0
smcpoland
9/4/2005 8:49:46 AM
asp.net.getting-started 91979 articles. 4 followers. Follow

6 Replies
3592 Views

Similar Articles

[PageSpeed] 38

My guess is you need to specify the full file path to iexplore.exe .
You may want to check the return value of Process.Start, if null, it
was not successful otherwise, it should return a Process valid object.

But this is not a recommended way of doing things.

Why don't you use the System.Net.WebRequest and System.Net.WebResponse classes to do the same, and without shelling out of your current process space?

Cheers,
Wim


Wim Hollebrandse
---
http://www.zealandit.com
0
WimH
9/4/2005 5:33:53 PM
Hi,

ASP.NET doesn't provide the needed privileges to do so. You can use impersonation (in your web.config, in the <identity> element) and use a user account that has enough privileges to start up the process.

Grz, Kris.
Read my blog. Handy Firefox plugins for web developers.


Workaround for non working Mark as answer buttons.
0
XIII
9/4/2005 6:50:05 PM
Many thanks for the replies:

Kris,

I should have said that I already impersonate in my code - apologises - I impersonate to the level of administrator. A bit high I know but for the sake of testing...

Th impersonation logs in correctly with no problems and my code is within the scope of the impersonation...
-----------------------
Wim,

as you suggest check the return code from Process.Start: I have rewitten my code as follows

EventLog.WriteEntry("Inventory PDR", "Before New Process.Start")
Try
     System.Diagnostics.Process.Start("IExplore.exe", "http://server/Inventory/add_pages/Preliminary_Delivery_Approval.aspx")
Catch oProcess As Exception
     EventLog.WriteEntry("Inventory PDR", "Process Error " + vbCrLf + vbCrLf + oProcess.Message)
End Try
EventLog.WriteEntry("Inventory PDR", "After New Process.Start")

which results in no error code - that is there is no exception generated.  I do get the "Before" and "After" messages but not the "Process Error" which would indicate to me that everything is fine.

I also added a reference to System.ComponentModel, which some seem to indicate is necessary but to no avail...

I also tried as suggested the path in the Process.Start ("C:\Program Files\Internet Explorer\IExplore.exe", "http://page reference") but this did not work either

I had a look at System.Net.WebRequest etc. but they do not meet the business requirements - they do not open the page for the user which is what I want...the user has to print the page for authorisation by management...electronic signatures will be installed later but not yet.

This is just so baffling - this should work surely...

Many thanks in advance
regards

0
smcpoland
9/5/2005 7:01:26 AM
 smcpoland wrote:
Many thanks for the replies:

-----------------------
Wim,

I also tried as suggested the path in the Process.Start ("C:\Program Files\Internet Explorer\IExplore.exe", "http://page reference") but this did not work either

I had a look at System.Net.WebRequest etc. but they do not meet the business requirements - they do not open the page for the user which is what I want...the user has to print the page for authorisation by management...electronic signatures will be installed later but not yet.

This is just so baffling - this should work surely...



Well, there's something else entirely which I just realized: since this forum is an ASP.NET forum I'm assuming you are doing this from a server page, ie. you are calling your library from a server page?

This will basically open an Iexplore.exe process on the server, and the client won't see this at all.

Having said that, if that were the case (you're calling this library from ASP.NET and want the client user to see this page), why don't you grab the HttpContext and redirect the user to this page?

System.Web.HttpContext.Current.Response.Redirect("http://yourserver/yourapp/page.aspx");

Hope that helps,
Wim

Wim Hollebrandse
---
http://www.zealandit.com
0
WimH
9/5/2005 8:31:02 AM

Ahhhh yes,

right - while it is .NET I am not sure if it is ASP.

I am doing this from the Folder Event Handler in Sharepoint Services, I am not sure how the system executes the exit in this case...but I see what you are saying when opening a process, it will obviously open on the server and not the client; a silly newbie mistake I suppose.

Must remember Client and Server are separate and not the same...nor are the processing threads...

Okay that said, again I don't know how the exit is being executed but when I tried the HttpContext class as suggested it returned "Object reference not set to an instance of an object." which tells me that a reference is not available for me to work with in this context.

I think I will have to come up with something else by way of a solution as it seems what I want to do is not possible.

Many thanks and kindest regards
Sean

 

 

0
smcpoland
9/5/2005 11:38:43 AM
From a source...it is impossible to do what I want to do, my thanks to Tom.

Your thinking is correct, however, that is not the way the event handlers in
SharePoint work.  The events are fired off asynchronously by the SharePoint
process and are independent of the client's session and/or action that
caused the event to fire, therefore, you cannot open a new IE window on the
client because the event data that is passed to your handler code does not
contain any relavent data about the client's session.

So yes, the solution you wish to develop is impossible using the SharePoint
event model.

Regards,

Tom Brownell
KnowledgeLake, Inc.
http://www.knowledgelake.com
0
smcpoland
9/7/2005 4:50:58 AM
Reply:

Similar Artilces:

Getting Start With .net
hi i'm intersted to learn asp.net (vb or delphi) . i programming with delphi6 but i'd like to tp know something about programming in internet specially with .net . i hear about microsoft.net with delphi 7 that i can programming with delphi in .net .... is it right ? what 's our opinian about it ? and better to learn Vb.Net or continu with delphi(or delphi.net) thanks. Ali Darabian I think there is some support for Delphi in .Net. However, you will find much more support from the user community if you choose a more popular language such as VB.Net or C#. Since your al...

how to get start with .NET
the net help people installed  to my desktop 1-microsoft visual studio .NET enterprise developer 2003 2-microsoft .NET framework 1.1 what else do i need ...???  and how can i try with some simple code in VS.Net and run it to see wat happen...????? please help If you want to develope web applications, then you'll also need IIS on your PC.  That'll require XP-Professional or Windows 2000/2003, but XP-Home edition won't allow IIS installation. As for how to get started, you can search the web for some tutorials or buy a good book on VS.  The topic is way too vast to...

Starting an Ajax.net Application in .net
i am new to ajax.net could any one give me simple ajax,net example so that i start building on my ajax skills please.........  I started with the todolist video on the main asp.net/ajax page, and its all you need to know to get started. http://download.microsoft.com/download/0/f/6/0f651a0f-6f2b-4497-b061-e1b2825e22e0/MSAJAX-ToDoList.wmv Don't forget to click "Mark as Answer" on the post that helped you.This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped. http://asp.net/ajax/    ...

Where to start and how did you get started?
Hi, I have had a feeling for a long time to jump into the adds market for some time due to my low income (shooting for the stars) and I don't have anything better to do these days. But I find it really difficult not to give up due to lack of guides (what I can find atleast) and all the hard words which only makes me confused. But I won't give up. Never. Not sure if this is the right place to post this, but I deffinitly would be really greatfull for help getting started. How did you get started? +If there are any teacher that wanna show me the ropes private, I can give payment with ...

Getting started with JScript.NET
I'm a Javascript and Actionscript developer, and the thought of being able to do server-sides in something I know was too good to resist. Does anyone know some good tutorials for developing ASP.NET pages in JScript?  I can find lots of console code, but simple things are hard: like I can't even figure out how to print something out to the web page (just a string). What I'm really trying to do is access a database, verify a login, and print JSON out to the response.  What should I do to start?  Is there a better way to do this? (IE: using some JSON library already?). I'm commun...

Getting started .net website
Hi folks,Does anyone here know of a good website to just sit back and read for learning .net? Thanks in advance.Baldeep Right here... Click the Get Started and Learn sections here. Quite a few out there - - this one, has a lot of good videos -  also ASPNet101.com, but then, I might be a little prejudiced David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(P...

How do I get started with AJAX.Net?
Hi All, I'm a seasoned asp.net developer but have not yet ventured into atlas et al.  I prefer books, but will take whatever I can get if it's good and will get me going. Any recommendations? Thx in advance. Jeff try here first http://ajax.asp.net/downloads/default.aspx?tabid=47 then learn from sample and docJames Wu (MIB426).NET is only way to goMCP, MCSE, MCDBA, MCSD, MCAD I find the materials online display features and implementations but are lacking architectural depth, and am seeking more comprehensive resources. By architectural depth, I mean that I cannot watch ...

Getting Started with .net and a few questions
Hello I've done some asp and php programming along with various other languages in the past and slowing getting my head around .net.I have a small project of creating a Holiday Booking system on our Intranet and just trying to get the first part to work properly will hopefully get me sorted for the whole project. The Intranet is running on .net 2 and I prefer to use the VB code rather than C#. This is connecting to an SQL server.My initial page that I am trying to create is just for an admin user to view which dates in a table have been specified as Bank Holidays and be able to add ...

I am trying to find .NET FrameWork class libraries and ADO.NET libraries maps to hang in my cube at work or at home.
Hello,    I am in search of the .NET Framework 1.x and 2.0 and 3.0 class library maps and ADO.NET class library maps to hang/pin to my cube at work and also at home. I believe that helps understand more about the Framework and also if some thing is presented in a pictorial representation I guess I can learn more than reading whole lot of stuff.   So is there a place on the net or any company that offers this to buy or down load?   Any inputs or help me finding on this is greately appreciated.   Thanks in advance, -L   The Visual Studio magazine use...

.Net Application generators
There are a few .Net complete n-tier application generators that generate directly from your database. Some even have their own database building tools. They are great and easy to follow and their applications generate real VB.Net and C# code, easy to learn. These are great starts for .Net stuff except for one thing, PRICE. Iron Speed is about $1500 and for the same exact product features ASPNetNow sells for only $279 for their Web Matrix version or $530 for VS version. Another company Avalanche sells for $995. Amazing price ranges. The first two match feature for feature except the first yo...

net start
Hi, having problems with the simple command net stop sqlagent$MYSQLNAME it give me an 1060 error. im running Windows 2003 standard and sql 2000 ...

.net start up
hi, i'm new with .net . i just install IIS6, Framework and SDK. what should i do next to test it is running ok? i have apache, php and mysql in my current laptop. should i uninstall it or will it be clash with .net? Hi,Run http://localhost/iisstart.asp to check if the IIS is working.If your apache server is using port 80 then you will need to change that because it will be used by IIS unless you are using Microsoft Visual Studio.By the way, you can run your php in IIS as well. Regards ASP.NET Hosting (HostingFest) Hi june_c21simply try this url in your webbrowser http://loc...

Getting Started Without VS.NET
Hi all, does anyone know how any online resources that can show me how to create web apps that include code-behind, and uer controls without using VS.NET? I have VS.NET in work, but would also like to do work at home, but cannot install VS.NET on my home laptop because I simply dont' have the space or processor power. Any online articles would be welcome, as will any open-source apps - I currently have SharpDevelop, but I find it unstable as it crashes my laptop alot of the time. Thanks Tryst Did you try Web Martix? It is a FREE tool from Microsoft.Regards, Narayana ...

EAServer not able to start Net-Library routine
Hi I get the following error messages in the server log file.Iam running the server (3.6.1) in Windows 2000 Advanced server. ---------------------srv.log-------------------------------- Application Integrator for CICS option is not licensed May 22 15:41:30 2002: SRVLIB Message: 16240/10/0: Net-Library routine net_listen(dnobizitep1 443) failed in srv__start_listeners Network error: status = 23 - Net-Lib protocol driver call to register a listener failed . . . May 22 15:41:43 2002: Executing {call portalinterfacedb..ps_valid_value_info (?, ?)}with parameters: May 2...

Web resources about - process.start in .NET class library - asp.net.getting-started

Andrussow process - Wikipedia, the free encyclopedia
Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. , a non-profit organization.

Is Digital Privacy Becoming a More Participatory Process?
... questioning the data companies collect. In an environment of changing data protection laws, and increased user participation in the process, ...

Peace process in Syria: Talk, talk, kill, kill
... up the Syrian opposition. The death of Zahran Alloush on December 25 is a reminder that the Syrian regime is willing to risk the Vienna process ...

Blair and Clinton: the peace process and fatherhood
The BBC has obtained redacted transcripts of phone calls and meetings between Tony Blair and Bill Clinton during 1997-2000, when they were both ...

"When Chris Wallace asks Bush if he squandered his initial advantage by failing to come up with a 'message' ...
... 'on the ballot in every state,' which is 'hard' to do and not every candidate has done. Of course, getting on the ballot is all about 'process,' ...

Southern flood victims begin long cleanup process - Videos - CBS News
It could be two weeks until flooded areas are dry again, but the Mississippi River is finally returning to its banks. David Begnaud is in Illinois, ...

Bush on Tamir Rice case: 'The process worked'
... with a toy gun. Breaking News CNN Toggle Search Search 2016 Washington Nation World Our Team CNN.com Bush on Tamir Rice case: 'The process worked' ...

Jeb! Bush: 'The process worked' in Tamir Rice grand jury in Chicago ... uh, Cleveland
Jeb! Bush is certain that “the process worked” when a grand jury declined to indict the police officer who killed 12-year-old Tamir Rice—after ...

Pakistan, Afghanistan agree on resumption of peace process
Army chief Raheel Sharif discusses reconciliation process, instituting border-management with Afghan President and CEO.

PGA Vetting Process Leaves Some Producers Out In The Cold
The PGA’s vetting process for producers usually raises eyebrows for omissions because those submissions usually go onto Oscar hopefuls. Among ...

Resources last updated: 1/9/2016 8:04:17 AM