|
What line is it dying on? I've never actually tried to use the Process class on a remote server, so I'm not sure what else to tell you. I don't see anything too glaring while looking over the code.
The Call Stack contains the list of methods that have occured during the current execution. Sometimes errors aren't so easy to find just by the error message and the stack helps you see what execution path your app took to create that error.
|
|
|
|
|
The code broke right after it execute @ proc.Start() and jump straight to the catch(Exception ex). Is there another way to execute a remote executable with switches on a remote server? I have looked into WMI but it doesn't allow me to execute an executable. I will be glad to try other ways if you show me how. Also, how do you look at the methods of the stack?
Thanks,
|
|
|
|
|
Maybe this will be of help? This person seemed to have the same issue and it turned out to be a permissions issue
http://forums.asp.net/t/1129890.aspx[^]
The call stack is displayed in the debugger when you hit a breakpoint. It's a window that can be displayed along side the output window.
Debug -> Windows -> Call Stack (CTRL-ALT-C)
|
|
|
|
|
Let's start over...
Do you have to run the EXE on the remote machine? Or do you run it on the local machine and tell it to gather data from the remote machine?
|
|
|
|
|
In my 27 years of coding for a living, I have never had to deal regular expressions. When you've recovered from your disbelief that anyone could for so long without having been exposed to this ungainly quagmire of coding fecal matter, here's my question:
I'm converting some php code to C#, and I ran into this line of php code:
preg_replace("/\:\/\/.*/", "", $blah)
The $blah string looks something like this:
php:
-- moved at 0:47 Wednesday 19th September, 2007
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi John,
I just bought RegexBuddy instead and let it do the hard work.
regards,
|
|
|
|
|
Can you run that through regexbuddy and tell me what it does?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It looks like it's removing the path, etc. so you are left with:
This is removed:
//www/owl/htdocs/index_sso.php --url=http://www.my.server/owl/
leaving:
php:browse.php
preg_replace("/\:\/\/.*/", "", $blah)
The '\' character in the regular expression escapes the following character so that any special meaning is ignored.
|
|
|
|
|
John Simmons / outlaw programmer wrote: this ungainly quagmire of coding fecal matter
Yep. It's not for ordinary mortals!
Kevin
|
|
|
|
|
PHP RegExp tester
looks like that one grabs the "php" (or "html" or whatever comes before the ':' ) off the front of the string.
|
|
|
|
|
That seems to me to be the long way around. I wonder why it didn't take off the colon as well?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
|
Yeah, regex's are incredibly handy when manipulating text. I use 'em all the time, much better than the finicky parsing code i used to write. Fortunately, C# / .NET has reasonably good support for them. The one you're looking at will strip off everything after php in the input string.
FWIW, i use this[^] for testing them.
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
Thanks, I'll download that and check it out.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
So Real programmers don't use RegEx.
|
|
|
|
|
It finds a colon, followed by two slashes, followed by 0 or more occurrences of any character, then replaces that with an empty string. In the example case, the preg_replace() function returns "php".
|
|
|
|
|
What part of the web development forum don't you understand? Not just a programming question but a PHP regular expression question. Sheesh.
This blanket smells like ham
|
|
|
|
|
"Web development" is too generic of a term, and since I wasn't really talking about *code*, where do ya go?
I was merely asking what the regular expression would do given the string it was being applied to. Regular expressions certainly aren't restricted to web development. CP doesn't have an appropriate forum selection for these kinds of questions. I really don't know why Chris moved this to the C# forum as it's not about C#, or even about PHP (no forum available).
I was surprised to find out there is a book about regular expressions, so maybe we should have a forum for that topic alone.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It could fit in any number of programming forums, but it does go in a programming forum. Where does a question about converting between C# and C++ go? I'm not sure, but it's not the lounge. If the regulars can't get it right how can we expect the new users to get it right.
This blanket smells like ham
|
|
|
|
|
Don't you think I considered all this before posting in the lounge? I was careful not to talk about coding, so as far as I'm concerned, you're in error, and I "got it right".
For what it's worth, it took 15 minutes to get an answer. I posted a php-specific question in the "Web Development" forum several hours ago, and as of this writing, nobody has responded. A lot of good it did me to post it there, eh?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: so as far as I'm concerned, you're in error, and I "got it right".
When is that ever not the case. You should have worked *gotten* in there though.
John Simmons / outlaw programmer wrote: For what it's worth, it took 15 minutes to get an answer. I posted a php-specific question in the "Web Development" forum several hours ago, and as of this writing, nobody has responded. A lot of good it did me to post it there, eh?
Well, I wouldn't expect much php help from CP anyway.
This is really pointless quibbling given that the post has already been moved, but I don't see how the question is any different then asking about some combination of ShowWindow flags. It's a parameter in an api method in both cases.
This blanket smells like ham
|
|
|
|
|
... are what your coworkers have when you spike the coffe machine with exlax.
--
If you view money as inherently evil, I view it as my duty to assist in making you more virtuous.
|
|
|
|
|
/\:\/\/.*/ becomes /://.* after you take out the escapes
.* = any character, any number of times
so it replaces the string /:// followed by any number of any characters by ""
Looks like the initial "/" is superfluous. Regular expressions can be specified by /expression/ - so be careful.
Assuming the "/" is a mistake, it would just chop off everything after "php".
Next time hit the right forum please. It lessons the impact of your vitriol on others who post programming questions in the lounge otherwise.
cheers,
Chris Maunder
CodeProject.com : C++ MVP
|
|
|
|
|
Chris Maunder wrote: Next time hit the right forum please. It lessons the impact of your vitriol on others who post programming questions in the lounge otherwise.
I think my original post straddled the line between a programming question and not a programming question, since it was merely asking what the results would be of a regular expression.
So what is the right forum for regular expressions? In my case, CP doesn't have a PHP forum, so I'm out of luck there. It certainly isn't necessarily C#, or C++.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|