console-application

Control console application from Windows form application C#

白昼怎懂夜的黑 提交于 2019-12-30 07:21:06
问题 I have 2 applications. One of them is console application, the other is normal form application - both written in C#. I want to open (hidden from view) the console application form the windows form application and be able to send a command lines to the console application. How can i do that? 回答1: You can start the background process ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "Myapplication.exe"; startInfo.WindowStyle = ProcessWindowStyle.Hidden; Process process

Control console application from Windows form application C#

二次信任 提交于 2019-12-30 07:21:03
问题 I have 2 applications. One of them is console application, the other is normal form application - both written in C#. I want to open (hidden from view) the console application form the windows form application and be able to send a command lines to the console application. How can i do that? 回答1: You can start the background process ProcessStartInfo startInfo = new ProcessStartInfo(); startInfo.FileName = "Myapplication.exe"; startInfo.WindowStyle = ProcessWindowStyle.Hidden; Process process

Exception on decrypting file using BouncyCastle PGP

廉价感情. 提交于 2019-12-30 07:13:35
问题 I was trying to decrypt this sample file given by the client, using a class called PgpDecrypt. But when the code comes to this line: Stream clear = pbe.GetDataStream(privKey); it returns an error: exception decrypting secret key Here's my decryption code: PgpDecrypt test = new PgpDecrypt(string.Concat(pathh, "TestDecryptionFile"), string.Concat(pathh, "mypgpprivatekey.key"), "mypassphrase", @"d:/test/", string.Concat(pathh, "clientpublickey.key")); FileStream fs = File.Open(string.Concat

NET Standard vs Net Core App: when creating .NET Core Project (using console or class library)

那年仲夏 提交于 2019-12-30 06:06:44
问题 I am trying to develop my projects to be cross platform. I have created several class libraries in this way: But, when I was using Entity Framework to scaffold my DB, the nuget packages needed didn't install except when used in Console application. Here is the difference, the console app references the .NET Core: And the Class library references NET Standard: So why they are both under .NET Core but referencing different libraries? Are both of them Cross Platform or only the console which is

NET Standard vs Net Core App: when creating .NET Core Project (using console or class library)

被刻印的时光 ゝ 提交于 2019-12-30 06:05:34
问题 I am trying to develop my projects to be cross platform. I have created several class libraries in this way: But, when I was using Entity Framework to scaffold my DB, the nuget packages needed didn't install except when used in Console application. Here is the difference, the console app references the .NET Core: And the Class library references NET Standard: So why they are both under .NET Core but referencing different libraries? Are both of them Cross Platform or only the console which is

What is the nicest way to close FreeGLUT?

瘦欲@ 提交于 2019-12-30 04:15:08
问题 I'm really having trouble closing my console application with FreeGLUT. I would like to know what the best way is to take every possible closing, because I don't want any memory leaks (I'm pretty afraid of those). So I already tried the following, which is giving me an exception like this: First-chance exception at 0x754e6a6f in myProject.exe: 0x40010005: Control-C. int main(int argc, char **argv) { if( SetConsoleCtrlHandler( (PHANDLER_ROUTINE) CtrlHandler, true) ) { // more code here as well

How to make text be “typed out” in console application?

我是研究僧i 提交于 2019-12-30 03:33:15
问题 Just like the way the computer does it in War Games. I've started, but I don't know where to go from here. static void TypeLine(string line) { string output = null; char[] characters = line.ToCharArray(); for (int i = 0; i < characters.Length; i++) { output += characters[i]; Console.Clear(); } Console.WriteLine(output); } My idea was to split the string you wanted it to output, add a character, clear the console, add another, and so on. I got that far, but I don't really know how to make it

Delphi 7: Handling events in console application (TidIRC)

喜你入骨 提交于 2019-12-29 08:16:09
问题 I'm trying to make a console application based on Indy's IRC Component (TIdIRC) but I'm having trouble with events. Here's my code: program Project1; {$APPTYPE CONSOLE} uses SysUtils, Classes, Math, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdIRC; type TEvents = class public procedure Raw(Sender: TObject; AUser: TIdIRCUser; ACommand, AContent: String; var Suppress: Boolean); end; const IrcServ = 'gr.irc.gr'; IrcPort = 6667; IrcChan = '#lalala'; var Irc: TidIRC; Event:

How do I detect when output is being redirected?

只愿长相守 提交于 2019-12-29 07:37:13
问题 I have a Win32 application written in C that can have its console output via printf() redirected to a log file. It would be nice if I could have my app. detect if it had been started with or without a redirect '>'. Any ideas? 回答1: Tom, thanks for the input. I did some experiments and found this works for me.. fpost_t pos ; fgetpos (stdout, & pos) ; When an application's output is being redirected to a file, fgetpos() sets 'pos' to zero. It makes sense since its freshly opened stderr for you.

how to bind a windows console application with java application?

人盡茶涼 提交于 2019-12-29 07:17:09
问题 i have an executable program (.exe) writen in c++ and run on windows console and i have a java swing applecation , so i want my java application to interact with the console app (send input and get output) . but how to do that ? 回答1: You can do it this way // Create the proccess in JAVA Process proc = Runtime.getRuntime().exec("Name of application"); // Receive outputs from another program inside Java by a stream InputStream ips = proc.getInputStream(); // Using the stream to get the messages