console-application

Error message “CS5001 Program does not contain a static 'Main' method suitable for an entry point”

本小妞迷上赌 提交于 2019-11-29 22:05:08
Unable to execute the following code error CS5001 Program does not contain a static 'Main' method suitable for an entry point What does this error message mean? class Program { static async Task MainAsync(string[] args) { Account.accountTest accountTest = new Account.accountTest(); bool result = await accountTest.CreateAccountAsync(); } } It means that you don't have a suitable entry point for your application at the moment. That code will nearly work with C# 7.1, but you do need to explicitly enable C# 7.1 in your project file: <LangVersion>7.1</LangVersion> or more generally: <LangVersion

Opening a TStream on stdin/stdout in a Delphi console app

孤街醉人 提交于 2019-11-29 20:22:08
I'm trying to write a Delphi console application that creates a TStream for its standard input, and another TStream for its standard output. (It will be launched by a host app with its input and output redirected to pipes, and will be passing binary data to/from that host app, so TStream will be much better-suited to the task than ReadLn/WriteLn.) How do I go about opening a TStream on standard input or standard output? Allen Bauer Off the top of my head: InputStream := THandleStream.Create(GetStdHandle(STD_INPUT_HANDLE)); OutputStream := THandleStream.Create(GetStdHandle(STD_OUTPUT_HANDLE));

Run interactive process inside already-running console application without opening new window

白昼怎懂夜的黑 提交于 2019-11-29 18:27:47
I realize this looks like a lot of other questions out there, but I looked at all of them for hours and never found the real answer I needed, so hear me out: This is for a .NET C# console application. Within it, I wanted to call a Windows executable using Process.Start , but without it opening a new console window when run. I also wanted the executable to be able to output to the console and respond to user input normally. How do you do this? Set ProcessStartInfo.CreateNoWindow , or ProcessStartInfo.WindowStyle ? Try to make input/output redirection work for hours on end? EDIT: smh ... this is

Node.js console gets closed immediately after i execute the program from Visual Studio 2012 in Windows 8

安稳与你 提交于 2019-11-29 18:17:40
问题 I have installed Node.js in Windows 8 PC and installed the Node.js plugin for Visual Studio 2012 . I executed a basic program from Visual Studio 2012 which just prints a string on console consol.log("Hi There"); The Node.js console prints " Hi There " and immediately terminates itself. Can anyone provide a solution to fix it? I have gone through a similar question, is there any other way to fix it apart from using setTimeOut() in the code? (Why does the Node.js scripts console close instantly

Automate mouse click in windows with script/batch file

给你一囗甜甜゛ 提交于 2019-11-29 17:38:26
问题 Firstly I'd like to point out that this is a rather strange question and also that I don't even know if stackoverflow is right for this... Anyways, is there a way to write a batch file or some other script that will automate a mouse click wherever the mouse pointer happens to be at the time the script runs? My main goal is this: Run script Check if the time is between 00:00am and 05:00am If it's not then continue running checking every 15mins. If it IS, then check if there is internet

'AttributeError' while trying to create a console screen using urwid

别等时光非礼了梦想. 提交于 2019-11-29 17:29:47
code below creates a layout and displays some text in the layout. Next the layout is displayed on the console screen using raw display module from urwid library. (More info on my complete project can be gleaned from questions at widget advice for a console project and urwid for a console project . My skype help request being here .) However running the code fails as an AttributeError is raised as described below. On looking at source code for urwid at /usr/lib64/python2.7/site-packages/urwid I see that both main_loop.py and curses_display.py have a draw_screen function with different arguments

Ruby Keyboard event handling

倾然丶 夕夏残阳落幕 提交于 2019-11-29 16:46:43
Hello im using curses to develop a small console application. I have a main loop section wich waits for user input, it uses the getstr function, of course this waits for the user to press enter. I would like to capture the up and down and tab keypresses. I suppose this can't be done with getstr. Anyone have any idea how to do this? EDIT: i've tried using STDIN.getc wich blocks the application from running, and getch doesnt catch the arrow keys EDIT #2 : im trying this code on windows. It seems that Curses.getch works for linux, but on windows i get no key sent for the up arrow. You need to set

Making my console application invisible

匆匆过客 提交于 2019-11-29 16:39:54
问题 I am developing a console application for my public library as a school project. The console application will run as soon as the user logs on and do some background work. The thing is, I don't want the console application to actually appear. I need it invisible. The last thing I need is complaints because some people got freaked out that a CMD window opened and closed, besides that the library wants it as invisible as possible. I tried following the code in this thread: http://social.msdn

Run console application (.exe) from within ASP.NET application (IIS 7,5)

老子叫甜甜 提交于 2019-11-29 15:52:28
I have an ASP.NET application on Windows 2008 R2 (.NET Framework 4.0, IIS 7.5) and I want to run a console application when I click a button on a web page. Here is the code: protected void btnUpdate_Click(object sender, EventArgs e) { string fileLocation = @"D:\DTDocs\App_Code\LoadDTDocsXML.exe"; ProcessStartInfo oStartInfo = new ProcessStartInfo(); oStartInfo.FileName = fileLocation; oStartInfo.UseShellExecute = false; Process.Start(oStartInfo); } When I run ASP.NET application from within Visual Studio 2010 (with its internal IIS), the console application run Ok. But when I run the ASP.NET

How would I make a Yes/No prompt in Console using C#?

跟風遠走 提交于 2019-11-29 15:25:34
问题 I'm mostly new to C# and I've been writing code to practice. I've written some code where you enter a line of text, or a "login key", and I want to make it where you can confirm that login key. Here's the code I've done so far, I will use "//" on the part I'm stuck on. (Wont include any unnecessary code.) Console.WriteLine("Please enter a login key."); string Key = Console.ReadLine(); Console.WriteLine("You entered, " + Key + " as your login key!"); Console.WriteLine("Are you sure you want to