console-application

What's the recommended way for console applications to talk with each other?

只谈情不闲聊 提交于 2020-01-24 14:14:47
问题 I got a system of console applications written in C# running on different machines. I use MSMQ. My questions is, how do I make my console applications communicate to each other? I'm asking because I want to create a new console application that can be queried by other applications to know the number of messages in MSMQ. Edit 1: Thanks for the replies and comments! About the requirements, I'm estimating maybe about 10-50/sec of queries 回答1: You need to use a pipe to achieve this: see Named

Visual studio (MAC) Console Application [duplicate]

半腔热情 提交于 2020-01-24 03:26:08
问题 This question already has answers here : External Terminal / Debug outside the IDE (2 answers) Closed 3 years ago . maybe some of you know, that Visual Studio (Preview) is ready to use. I have simple question, maybe I did something wrong, or it doesn't work properly. When I start to debug Console Application doesn't want to let me read name from keyboard. string name = Console.ReadLine(); Console.WriteLine(name); Can someone help me? I'd like to see how it works correctly. 回答1: By default VS

How to get the screen size of Console Application?

删除回忆录丶 提交于 2020-01-23 07:10:54
问题 How do you get the screen size in a console application? 回答1: var w = Console.WindowWidth; var h = Console.WindowHeight; --EDIT-- Screen.PrimaryScreen.Bounds Screen.PrimaryScreen.WorkingArea 回答2: If you want get display size you can use WMI(Windows Management Instrumentation) var scope = new ManagementScope(); scope.Connect(); var query = new ObjectQuery("SELECT * FROM Win32_VideoController"); using (var searcher = new ManagementObjectSearcher(scope, query)) { var results = searcher.Get();

ApplicationData using in Console with UWP parameters

左心房为你撑大大i 提交于 2020-01-23 03:46:06
问题 I'm trying to follow UWP with Desktop Extension – Part 2 of UWP and WinForms desktop-bridge calling the processes and passing parameters. This example Console Program.cs code includes parameters string: string parameters = ApplicationData.Current.LocalSettings.Values["parameters"] as string; But the name ApplicationData does not exists in the current context, I'm trying to find out, if I've missed some reference or it is different version of C# I'm not sure even if it is what it requires, but

How do I add a form to a console app so that user can select file?

自闭症网瘾萝莉.ら 提交于 2020-01-23 01:11:07
问题 I have created a console application and have it working the way I want it to. Using the "Add Item" > "Add Windows Form" option in VS2010, it has automatically created what I need. I have added a button and code to retrieve an Excel file (below) My question is: How do I take the file they have created and use it in my program.cs "Main" area? The code for the OpenFileDialog button click event, from the Form1.cs: private void btnSelect_Click(object sender, EventArgs e) { OFD.openFileDialog OFD

Convert Winform App to Console app

£可爱£侵袭症+ 提交于 2020-01-21 06:49:26
问题 Is there a quick and dirty way (or a VS Macro) to convert a WinForms app to a Console App? I have a number of these apps that are no longer needed as Winforms apps. I suppose I could create a bunch of new projects and copy paste modules and classes over, but if it's just a matter of removing the single form that I have and editing/deleting a few things, I'd rather do that. 回答1: You can change the project settings to create a Console Application instead of a Windows Application (just hit Ctrl

How can I specify the window position of an external console program?

混江龙づ霸主 提交于 2020-01-20 22:08:30
问题 In my Win32 VCL application I am using ShellExecute to launch a number of smaller Delphi console applications. Is there a way to control the position of those console windows? I would like to launch them centered on screen. 回答1: If you have control over the console application, You could set the console window position from inside the console application itself: program Project1; {$APPTYPE CONSOLE} uses Windows, MultiMon; function GetConsoleWindow: HWND; stdcall; external kernel32 name

Selenium ChromeDriver how to disable the message:"DevTools on ws

纵饮孤独 提交于 2020-01-20 06:51:23
问题 So I am creating a bot with chrome headless browser and it works just fine. I had quite a lot warnings so I disabled them after reasearch with those commands: ChromeOptions option = new ChromeOptions(); option.AddArgument("--headless"); option.AddArgument("--silent"); option.AddArgument("--disable-gpu"); option.AddArgument("--log-level=3"); ChromeDriverService service = ChromeDriverService.CreateDefaultService(); service.SuppressInitialDiagnosticInformation = true; _driver = new ChromeDriver

Run PowerShell-Script from C# Application

假如想象 提交于 2020-01-19 05:07:08
问题 I'm trying to execute a PowerShell script from a c# application. The script has to be executed under a special usercontext. I've tried different scenarios some are working some not: 1. direct call from PowerShell I've called the script directly from a ps-console which is running under the correct usercredentials. C:\Scripts\GroupNewGroup.ps1 1 Result: Successfully running the script. 2. from a c# console application I've called the script from a c# consoleapplication which is started under

WCF Named Pipes timeout in a WinApp, but not in a ConsoleApp?

瘦欲@ 提交于 2020-01-17 08:35:13
问题 In relation to Async two-way communication with Windows Named Pipes (.Net) which seems dead (the thread that is) :/ I'm wondering why the following code works perfectly in a ConsoleApplications, but when I do exactly the same thing with WindowsApplications I get an timeout on the client when calling "Console.WriteLine(proxy.ProcessData());". The strange thing is that the server method "ProcessData" is called without any exceptions, but still I get a timeout after the default 1 min?! How can I