console-application

Best practice to include console app in NuGet

谁说我不能喝 提交于 2019-12-23 04:16:08
问题 I'm developing an open-source library which mainly consists of one class-library project targeting .NET Standard 2.0. On top of that, I've also implemented a console app which is the CLI to this library. The console project (for historic reasons) only targets .NET Framework 4.6.2. Now I wonder what would be the best practice in order to make this console app available to the community. On the broadest level, I see two possibilities: Ship the console app as a separate NuGet. Ship the console

scheduled task run .exe problem

旧巷老猫 提交于 2019-12-23 03:59:24
问题 I have a c# console app that writes some text to a txt file when runs. I have added it in scheduled task. the task runs without error on a scheduled time... but the console window dose neither pop up nor any text in the destination file! any idea where is the problem? I'm on windows server 2008 r2. 回答1: The console does not show because the scheduled task does not run as an interactive user. Text is not written in the dest file because probably it is not accessible by the user running the

Getting output from one executable in an other one

孤街醉人 提交于 2019-12-23 03:23:13
问题 I'm currently trying to get the output of an executable console-app into an other one. To be exact, a little overview of what I'm trying to do: I have one executable which I cannot edit and neither see it's code. It writes some (quite a bunch to be honest) lines into the console when executed. Now I want to write another executable that starts the one above and reads the things it writes. Seems simple to me, so I started coding but ended up with an error message saying that StandardOut has

Starting a console application from asp.net using authenticated user credentials

瘦欲@ 提交于 2019-12-23 02:44:12
问题 I have the following asynchronous controller actions which allows me to start a console application on a remote server. My issue is with regards to the permissions and authentication. I have tried the following, which in my understanding allows the app.Start(valuationDate) to run as the impersonated user . The reason for this is that the console application needs to access network resources and the user of this web app will have the required access rights. (As a side note, the console app

Limiting the input in the Console

风流意气都作罢 提交于 2019-12-23 00:46:28
问题 I'm making a maze game. how can i limit the number of characters the user will input after Console.Read()? i need to limit it so that if the user inputs a very long string, it will overwrite my Maze. If you're planning to tell me to just rewrite the maze afterwards, i'll say no. I can't. It will require me another long process, believe me. I just want a simple code for limiting the input. Here's a screenshot demonstrating the problem. You see that asdasjhasd.... in the screen? See how it

What exactly is classified as a “symbol” in C#?

南笙酒味 提交于 2019-12-22 18:22:03
问题 So I am trying to write a program that asks for you to create a password. I have a block of code that checks to see if the string entered by the user contains a symbol. I have the code set to exit the loop when the boolean value 'validPassword' equals true. string pleaseenterapassword = "Create a password:"; bool validPassword = false; Console.WriteLine(pleaseenterapassword); // Writes to the screen "Create a password:" string password = Console.ReadLine(); //Sets the text entered in the

How to send Return/Enter character to the Console using WriteConsoleInput/WriteConsole

孤街醉人 提交于 2019-12-22 18:07:12
问题 I have the following piece of code. I want to send the command "uci" and then Return/Enter to the console. However, I got no success doing so. Please kindly advise. Thank you! #include <conio.h> #include <iostream> #include <windows.h> DWORD WINAPI test(LPVOID lp) { system("edit"); return 0; } int main(int argc, char* argv[]) { /* HANDLE hConIn = CreateFile("CONIN$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); HANDLE hConOut = CreateFile(

Running a c++ console app inside a C# console app

不想你离开。 提交于 2019-12-22 14:55:33
问题 I have a c++ console app which runs in visual studio. This collects data and displays it in the console with all the raw data. Another app (C#) is used to collect this information and present it to the UI. Is it possible to combine the two by putting the C++ one inside the C# one so that both run at the same time as one service with the C++ app outputting its info to a panel or anything similar? Thanks! :) 回答1: A very quick example I have to do something like I said earlier is this: private

Running a c++ console app inside a C# console app

核能气质少年 提交于 2019-12-22 14:55:03
问题 I have a c++ console app which runs in visual studio. This collects data and displays it in the console with all the raw data. Another app (C#) is used to collect this information and present it to the UI. Is it possible to combine the two by putting the C++ one inside the C# one so that both run at the same time as one service with the C++ app outputting its info to a panel or anything similar? Thanks! :) 回答1: A very quick example I have to do something like I said earlier is this: private

Hide Title Bar of Program using API

心不动则不痛 提交于 2019-12-22 08:19:30
问题 Its possible remove a window console title bar using c# and windows api, if yes howto? Please. 回答1: This simple app hides and shows the title bar of the console that it's in. It changes the console title to a guid momentarily to find the window handle. Afterwards it uses ToggleTitleBar to show or hide using the found handle. public class Program { public static void ToggleTitleBar(long hwnd, bool showTitle) { long style = GetWindowLong(hwnd, -16L); if (showTitle) style |= 0xc00000L; else