you don't need to convert the script to an exe. If you have the perl windows
version installed, you can fire off the cmd window and then write the script
along with its arguments into the cmd window . I like this approach because
you can actually read the returned value from the script if you needed to,
setting up an ad hoc communication mechanism between your application and
the script.
Consider:
//create the temp table
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = @"cmd";
myProcess.StartInfo.UseShellExecute = false;
//we will use the standard out to communicate between programs
myProcess.StartInfo.RedirectStandardInput = true;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.Start();
StreamWriter sIn = myProcess.StandardInput;
sIn.AutoFlush = true;
StreamReader sOut = myProcess.StandardOutput;
sIn.Write("Perl " + @"d:\perlscripts\retail_merge_request.pl" + " Arguments
go here " + System.Environment.NewLine);
sIn.Close();
The effect of this is the same as if you navigated to a dos cmd prompt and
typed in
<< retail_merge_request.pl arguments go here >>
and then pushed enter
You can read the results if your script writes output like so
string results = sOut.ReadToEnd().Trim();
sOut.Close();
--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
dana livni said:
i'm not sure, like i said i'm new at this.
the program that i tried to run is actually a perl script that i
compieled into an exe file.
the scrict approach the internet, (send a get command) parss the page
he gets back, and insert some data into a database.
when i tried to run notepad.exe i think it ran because i so it on the
procces list. but my script dosn't.
what sould i do?