473,324 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 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 2003
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.