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
340 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
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now