472,805 Members | 894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Running a Console App from ASP.Net

I'm trying to encypt a file using PgpCmdLn 6.5.8 from an asp.net page. My
code looks like this:
private String ExecuteProcess(String Arguments)

{

String msg = String.Empty;

try

{

if(this._pgpPath == null || this._pgpPath == String.Empty)

throw new Exception("The path to the Pgp cmdline application must be given!
");

Arguments +=GetSettings();

compiler = new Process();

compiler.StartInfo.FileName = this._pgpPath + "\\pgp.exe";

compiler.StartInfo.Arguments = Arguments;

compiler.StartInfo.UseShellExecute = false;

compiler.StartInfo.CreateNoWindow = true ;

compiler.StartInfo.RedirectStandardOutput = true;

compiler.Start();
DateTime StartTime = DateTime.Now;

compiler.WaitForExit(_wait);

// while((long)((TimeSpan)(DateTime.Now - StartTime)).TotalSeconds < _wait)

// {

// if(compiler.HasExited)

// break;

// }

if(!compiler.HasExited)

compiler.Kill();

msg = " " + compiler.StandardOutput.ReadToEnd();

compiler.Dispose();

if(msg.ToLower().IndexOf("error",0) > 0 ||
msg.ToLower().IndexOf("warning",0) > 0)

{

throw new Exception("Pgp error: Arguments(" + Arguments + ")" );

}

return msg;
}

catch( Exception err)

{

throw new Exception( err.Message + " :: " + msg);

//Cannot find the public key matching userid

}

}

When I run this code from my aspx page I'm prompted for random data: "PGP
needs to generate some random data. This is done by measuring the time
intervals between your keystrokes. Please enter some random text on your
keyboard until the indicator reaches 100%. Press ^D to cancel 0% of required
data "

How can I do this? Can someone give me an example? Thanks in advance.


Jul 21 '05 #1
1 1983
More Info: What I'd like to do is redirect the stdin to enter this random
data. I have tried this but with no luck. Can someone give me an example
of this? In particular - an example where the console application is
prompting for additional input.
"foobar" <es***@inbizservices.com> wrote in message
news:OV**************@TK2MSFTNGP14.phx.gbl...
I'm trying to encypt a file using PgpCmdLn 6.5.8 from an asp.net page. My
code looks like this:
private String ExecuteProcess(String Arguments)

{

String msg = String.Empty;

try

{

if(this._pgpPath == null || this._pgpPath == String.Empty)

throw new Exception("The path to the Pgp cmdline application must be given! ");

Arguments +=GetSettings();

compiler = new Process();

compiler.StartInfo.FileName = this._pgpPath + "\\pgp.exe";

compiler.StartInfo.Arguments = Arguments;

compiler.StartInfo.UseShellExecute = false;

compiler.StartInfo.CreateNoWindow = true ;

compiler.StartInfo.RedirectStandardOutput = true;

compiler.Start();
DateTime StartTime = DateTime.Now;

compiler.WaitForExit(_wait);

// while((long)((TimeSpan)(DateTime.Now - StartTime)).TotalSeconds < _wait)
// {

// if(compiler.HasExited)

// break;

// }

if(!compiler.HasExited)

compiler.Kill();

msg = " " + compiler.StandardOutput.ReadToEnd();

compiler.Dispose();

if(msg.ToLower().IndexOf("error",0) > 0 ||
msg.ToLower().IndexOf("warning",0) > 0)

{

throw new Exception("Pgp error: Arguments(" + Arguments + ")" );

}

return msg;
}

catch( Exception err)

{

throw new Exception( err.Message + " :: " + msg);

//Cannot find the public key matching userid

}

}

When I run this code from my aspx page I'm prompted for random data: "PGP
needs to generate some random data. This is done by measuring the time
intervals between your keystrokes. Please enter some random text on your
keyboard until the indicator reaches 100%. Press ^D to cancel 0% of required data "

How can I do this? Can someone give me an example? Thanks in advance.


Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: David Olive | last post by:
Hi guys, I'm having a bit of a problem getting a VB .NET console app to run happily as a scheduled task. The app itself generates a bunch of word documents on a file share on another server by...
2
by: Jacek | last post by:
Hello! My application has to use external native library writing to stdout and stdin. My goal is to redirect output within running process (no chance to do that in child process - Process class...
2
by: Jeffrey Palermo, MCAD.Net | last post by:
I have some classes that control file processing in c#. The files come from a mainframe and may take some time for each to process. I use the Threadpool to process multiple files at once. Each...
4
by: sneffe | last post by:
Hi, im writing a program to keep track of which programs is currently running. I would like to have the caption of running programs displayed in a textbox on my form. I cant seem to find an easy way...
3
by: Kevin L | last post by:
How do I check to see if a particular service is running?
2
by: Chris Fink | last post by:
Using WMI, how do I retrieve the list of running applications on a pc? If you open up task manager and click on the applications tab, I am trying to retrieve the task name and the status. I...
8
by: nadeem_far | last post by:
Hello All, These days I am working on a console application that will register for certain events and do some processing based on the event notification. Now, all the objects are being created...
5
by: plmanikandan | last post by:
Hi, I have written a win32 console application(exname1.exe) which runs for ten minutes.I am calling this exname1.exe from another exe named exname.exe using shellexecuteex.Now from exname.exe...
17
by: Csaba Gabor | last post by:
Is there a way to determine the path to the php executable (as opposed to the script. In other words, I am looking for the path to php.exe or php-win.exe) that is currently running (ie. how was...
2
by: tom.sikes | last post by:
We wrote some code (utility stuff) that is intended to run as part of either a windows service, a console app or a windows app. What I'd like to do is when it is running as a service have it log...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.