console-application

Question concerning Win32 Console app vs. CLR Console app

Hello, I'm working on a C++ project that I don't intend to develop or deploy using .NET libraries or tools, which means it would make sense for me to create it using a Visual Studio Win32 Console application. However, I've heard that the debugging abilities when using a CLR application under Visual Studio are much more powerful. So I ...

Stop VB application from running in background

I have a console application (written in VB6 ) which is behaving strangely on my machine. I kick it off from the command line and what should be a two minute job drops straight back to the prompt - if I run this on another machine the executable will sit and wait until the job finishes before returning control back to the prompt. If I ch...

How can I use System.Web.Caching.Cache in a Console application?

Context: .Net 3.5, C# I'd like to have caching mechanism in my Console application. Instead of re-inventing the wheel, I'd like to use System.Web.Caching.Cache (and that's a final decision, I can't use other caching framework, don't ask why). However, it looks like System.Web.Caching.Cache is supposed to run only in a valid HTTP context....

c# console application - prevent default exception dialog

I have simple application with single AppDomain which is periodicaly launched on a server. Sometimes unhandled exception occurs in the aplication and default abort/retry/ignore dialog pops up. I need to somehow prevent the edialog from showing and just output the exception on StrErr and close the application. So I enclosed all the code i...

Monitor process standard output that does not necessarily use CR/LF

My application periodically starts console programs with process.start. I need to monitor the output of the programs in "realtime". For example, the program writes the following text to the console: Processing................. Every second or so a new dot appears to let the user know the program is still processing. However,... until ...

What happened to the context menu in my console application?

Was creating a simple console application to do some prototyping and was shocked to see that the right-click/context menu is missing from a standard .NET console app! I'm unable to find any information about this, and intellisense isn't helping. So what happened to it? Can I get it back? And if not, how can I configure my console app...

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

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 ReadL...

need help with c# , fibonacci

hi , urm... i am practising c# console application , and am trying to get the function to verify if the number appears in a fibonacci series or not but im getting errors what i did was class Program { static void Main(string[] args) { System.Console.WriteLine(isFibonacci(20)); } static int isFibonacci(int n) ...

Application crashes when calling embedded resources

I'm writing a console application in Visual Basic 2008 Express. I added several text files to my project as resources. Specifically... I went to my project's "Properties" page and selected the "Resources" tab. I clicked the "Add Resource" dropdown and chose "Add New Text File". I entered some simple text and saved the file as "W...

Trying to read in some command line arguments for a console application

Hi folks, i've got a pretty simple .NET console application. I wish to pass in some command line arguments ... nothing tough there. Now, the kicker is, i usually have a LIST of items i wish to pass in, for one argument. In this case, a list of files. I'm not sure of the best way to do this. eg. myapp.exe files=aaa.txt,bbb.txt,ccc.txt ...

.NET Console Application Exit Event

Using .NET is there a method, such as an event, of detecting when a Console Application is exiting, I need to clean up some threads and COM objects? I am running a message loop, without a form, from the console application. A DCOM component that I am using seems to require that the application pump messages. I have tried adding a hand...

Hooking up events and what to do with app afterwards

I have a basic SMS interception application on a windows mobile phone, currently this is a console application that hooks up the MessageReceived event of the MessageInterceptor class. Once i've done that my program runs to compleation, my Phone will then display the 'busy circle' untill I do something else but my event handlers still ge...

c# mileage counter

A mileage counter is used to measure mileage in an automobile. A mileage counter looks something like this 0 5 9 9 8 The above mileage counter says that the car has travelled 5,998 miles. Each mile travelled by the automobile increments the mileage counter. Here is how the above mileage counter changes over a 3 mile drive. After the ...

Why does Console.Out.WriteLine exist?

Actually the question should be why does Console.WriteLine exist just to be a wrapper for Console.Out.WriteLine I found this little method using intellisense, then opened .NET reflector and 'decompiled' the code for the Console.WriteLine method and found this: public static void WriteLine(string value) { Out.WriteLine(value); } S...

Is there a better alternative to Console.ReadKey()?

Most programming books will tell you to use Console.ReadKey() to pause the console, but is there a better alternative? Console.WriteLine("Press any key to continue."); Console.ReadKey(); ...

Is there a way to inject behavior to csrss.exe and modify/enhance windows console?

I'm aware of Console2 and similar solutions, but I would really like to enhance every console window in my system. Any ideas? ...

How can a C# Windows Console application tell if it is run interactively

How can a Windows console application written in C# determine whether it is invoked in a non-interactive environment (e.g. from a service or as a scheduled task) or from an environment capable of user-interaction (e.g. Command Prompt or PowerShell)? ...

C++ Real time console app, simultaneous input and output

I'm writing a quick server app for something so don't really want to write a full GUI. However the problem is that the main part of the server, however the console window will only allow input or output at a time. Many games ive played that have a console in them (usually needs activating in some way or another) they solved this problem...

What will give me the same result as FormsAuthentication hashing for a non web application?

I have written a quick console app to quickly go and generate usernames and logins for my web application for existing accounts that did not have properly hashed passwords. In my web application I am using FormsAuthentication like so: string hashedPwd = FormsAuthentication.HashPasswordForStoringInConfigFile(saltAndPassword, "SHA1"); I...

How to disable Control-C in a WindowsXP Python console program?

I'd like to put my cmd.com window into a mode where Control-C does not generate a SIGINT signal to Python (ActiveState if it matters). I know I can use the signal module to handle SIGINT. The problem is that handling SIGINT is too late; by the time it is handled, it has already interrupted a system call. I'd like something equivalent t...