Solved

How can I have my c# code run a perl script and know when the script has been completed

Posted on 2008-06-25
1
343 Views
Last Modified: 2008-06-27
I have a perl script that compiles a bunch of data...I want to be able to fire off that script as a part of a larger routine..So I need to figure out how to A run the perl script inside the c# app but compiling the data takes about 15 minutes..so I need a way to have the app be able to identify when the script has completed and then continue running the rest of its routine.


The c# app is running as a web service

0
Comment
Question by:Prysson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 16

Accepted Solution

by:
CuteBug earned 500 total points
ID: 21866112


ProcessStartInfo ps = new ProcessStartInfo("perl.exe", "program.pl args");
ps.UseShellExecute = false;
ps.RedirectStandardOutput = true;
Process p=new Process();
p.Start(ps);
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question