console

Windows form from console

馋奶兔 提交于 2020-01-11 03:02:05
问题 I would like to spawn a Windows form from the console using C#. Roughly like display does in Linux, and modify its contents, etc. Is that possible? 回答1: You should be able to add a reference for System.Windows.Forms and then be good to go. You may also have to apply the STAThreadAttribute to the entry point of your application. using System.Windows.Forms; class Program { [STAThread] static void Main(string[] args) { MessageBox.Show("hello"); } } ... more complex ... using System.Windows.Forms

Libraries for displaying a text-mode menu?

安稳与你 提交于 2020-01-10 20:11:07
问题 In a game project I was working on, I was seriously slowed down -- to the point of giving up -- by how there don't seem to be any libraries that can simplify the process of displaying a menu in text mode (i.e., 80x25 textbox, command.com/cmd.exe's native interface). I need something that can give a list of choices, ideally including multiple pages, and including values to be entered to choose one of these; prompt the user; gently chide the user (perhaps ringing a bell and redrawing the

Libraries for displaying a text-mode menu?

我的未来我决定 提交于 2020-01-10 20:08:30
问题 In a game project I was working on, I was seriously slowed down -- to the point of giving up -- by how there don't seem to be any libraries that can simplify the process of displaying a menu in text mode (i.e., 80x25 textbox, command.com/cmd.exe's native interface). I need something that can give a list of choices, ideally including multiple pages, and including values to be entered to choose one of these; prompt the user; gently chide the user (perhaps ringing a bell and redrawing the

Unsafe JavaScript attempt to access frame with URL

微笑、不失礼 提交于 2020-01-10 18:20:11
问题 I've incorporated Vimeo into a WordPress theme I'm building, and I get these errors: Unsafe JavaScript attempt to access frame with URL http://themes.ibrogram.com/beta/blog/ from frame with URL http://player.vimeo.com/video/4749536. Domains, protocols and ports must match. Unsafe JavaScript attempt to access frame with URL http://themes.ibrogram.com/beta/blog/ from frame with URL http://player.vimeo.com/video/28496744?title=0&byline=0&portrait=0. Domains, protocols and ports must match. It

Log4j How do I stop my logger from printing to the console?

时光总嘲笑我的痴心妄想 提交于 2020-01-10 03:51:26
问题 Okay so I'm trying to make a memory appender (simply a logger, that logs to an ArrayList instead of the console or to a file) but for now I want to disable it from printing to the console. The questions and websites, I've read so far (but I still cant figure it out is).. StackOverFlow Question log4j: Log output of a specific class to a specific appender StackOverFlow Question log4j : Disable log4j console logging and enable file logging Coder Launch: log4j: stop logging to console It has all

How to tell if a windows PE file is a console subsystem or a windows subsystem programmatically?

北城以北 提交于 2020-01-10 03:16:08
问题 Basically I need a program that will sort windows .exe's from the console counterparts. A file scanner: SortExe(file exe) { if (IsPeWindows(exe)) { AddToList1(exe); } else if (IsPeConsole()) { AddToList2(exe); } } How do I implement IsPeWindows or IsPeConsole() ? I do not particularly mind what language solutions come in so long as it's one of c, c++, c# or visual basic. 回答1: Pass SHGFI_EXETYPE to SHGetFileInfo() & examine the hi/loword of the return value as explained in the link. 来源: https:

Programmatically clicking all buttons on a page in Chrome's console

拟墨画扇 提交于 2020-01-09 18:23:10
问题 I'm trying to use the Chrome console to select all the buttons in a page and click them programmatically. A similar page to what I'm playing with is this one: http://api.openstack.org/api-ref.html#compute-ext I already tried to execute the command below but it didn't do what I wanted. $("btn small info").click() Is this possible at all? What command should I issue? 回答1: Well, you want to make sure you only select the buttons in the section so you are not running the search. $("#body .btn")

Console application freezes on mouse click

安稳与你 提交于 2020-01-09 10:51:29
问题 I have a very simple C# console application that displays some text and loops waiting for input until the escape key is pressed or the timeout period is served. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; namespace SampleApp { public static class Program { public static void Main (string [] args) { var key = new ConsoleKeyInfo(); var watch = Stopwatch.StartNew(); var timeout = TimeSpan.FromSeconds(5);

Console application freezes on mouse click

社会主义新天地 提交于 2020-01-09 10:51:16
问题 I have a very simple C# console application that displays some text and loops waiting for input until the escape key is pressed or the timeout period is served. using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading; namespace SampleApp { public static class Program { public static void Main (string [] args) { var key = new ConsoleKeyInfo(); var watch = Stopwatch.StartNew(); var timeout = TimeSpan.FromSeconds(5);

Listening console.log

五迷三道 提交于 2020-01-09 10:25:07
问题 I want to set a listener for console.log() and do something with the message without preventing the default behaviour. So, the console of the dev tools should get the message as well. Any ideas? 回答1: Never tried this in a webpage, but it work in a browser plugin (where javascripts rights are are not the same for security reasons). You could definitively go for something like this : (function(){ var originallog = console.log; console.log = function(txt) { // Do really interesting stuff alert(