console-application

How to escape spaces containing path

To pass a path with spaces to .NET console application you should escape it. Probably not escape but surround with double quotes: myapp.exe --path C:\Program Files\MyApp becomes new string[] { "--path", "C:\Program", "Files\MyApp" } but myapp.exe --path "C:\Program Files\MyApp" becomes new string[] { "--path", "C:\Program Files\MyApp"...

how to get all html tags from html file in the list using regular expression

file contains tag as <html><head></head><body><span class=style32></span>.... i want only the html tag i.e span,head,body in list.There should not be duplicates. please help me i'm new to regular expressions. ...

Can I pass dynamic parameters to a console app from a scheduled task?

In perfmon on Vista and up you can trigger a scheduled task when a performance counter gets to high or low. From the perfmon end I can add task arguments. When I create the task through task scheduler I cannot find any way to work with these parameters or to pass them on to the console app the task triggers. Am I missing something? I...

Should I develop my game idea in text mode first?

I recently came up with an idea for a simulation/strategy game. I've been sketching out a lot of my ideas on paper about the game mechanics as well as have a few of the basic classes and objects working. (I'm writing this in C# using XNA). One thing that is painfully obvious to me though is that I am not a graphic artist and trying to...

Is it possible to deploy DLL's to separate directory than the executable for a console application?

Is there a way in .NET C# Console Application to deploy the executable to a different directory than the DLL's it depends on? In this case I would like to structure my deployment so that on the server where this will run I have the following directory structure. c:\app\bin\sample.exe c:\app\dll*.dll ...

C# console app - explicit termination (not Env..Exit)

Hi, I have heard that on .NET CF Environment.Exit does not work. Is there any universal way how to terminate (in a standard way) the console app? Thank you ...

Clear Console Buffer

I'm writing a sample console application in VS2008. Now I have a Console.WriteLine() method which displays output on the screen and then there is Console.ReadKey() which waits for the user to end the application. If I press Enter while the Console.WriteLine() method is displaying then the application exits. How can I clear the input ...

Is there .net magic to get parameter values by name in console application?

I've been developing .net console applications using C# and have always just dictated what order parameters must be inserted in so that args[0] is always start date and args[1] is always end date, for example. however I would like to move over to using named parameters so that any combination of parameters can be sent in any order, such...

What happens when starting a .NET console application?

What exactly happens when a .NET console application starts? In the process explorer, when starting the exe I am wondering why I cannot see a "cmd.exe" process as a parent process for the console application. What exactly is displayed then? Is there a way to replace the "default" console window by another one? I guess this would mean m...

Disabling paste in console application

Hi there, So, here's a weird question: Is there a way for me to disable the menu you get when pressing the "C:\" button at the top left of the console? I am making a game, for fun, but it would take away alot of the fun if players were able to paste words into the command-line. I haven't found any topics about it, so I was wondering i...

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine()

I'm trying to create an application that adheres to the following: No Taskbar No console or form window Can utilize Console.WriteLine(). (i.e. If someone executes the app from command prompt it will actually write to that console.) The problem is if I create a Windows Form (or WPF) application I can have it so that there is no taskba...

Using kbhit() to pause terminal output?

I took my first 'fundamentals of programming' lab session at uni today. One thing struck me as odd, though: the use of while(! _kbhit()) from conio.h (which I'm sure is a C unit?) to 'pause' the console output. Is this the best way to do this? What do I need to watch out for when using it? Is my tutor absolutely bonkers? I only ask beca...

Move up one line in console (Pascal)

Hey all. I'm sitting at college making a noughts and crosses game while everyone else is learning the basics of Pascal. I can print the 2D array denoting the board into the terminal just fine, but what I want to do is update the board everytime a player adds a nought or cross, or moves their cursor around. To do this, I want to over-wri...

Hide Console Window in C# Console Application

The thing is, i really dont want the console window to show up...but the solution should be running. My point here is, I want to keep the application running in the background, without any window coming up. ...

How to output multiple byte characters normally in c/c++ console application?

printf("%s\n", multibytestring); By default the multi-byte characters will show up like ??? in console, how can I fix it? ...

Umbraco Document.getProperty(...).Value throws Null Reference Exception

I am writing a small app that links into Umbraco (a small stand-alone console application that will eventually run as a scheduled task on the server) and I'm using the Umbraco APIs (4.5.2) to make changes to the database/document. Here is a fragment of what I'm doing: IEnumerable<Document> documents = Document.GetChildrenForTree(parent...

C# image manipulation using a console application throwing 'Out of Memory' Exception

I have a console application that successfully re-sizes an image while maintaining aspect ratio. I now need to crop the image the code I am using is below: using (var thumbnail = CropPicture(image, rectangle)) { EncoderParameters encParams = new EncoderParameters(1); encParams.Param[0] = new EncoderParameter(System.Drawing.Imag...

Update and multiple console windows

Hello; I want to write a simple c++/c console app, to show my process 1% 2%. for now, i print it line by line like "finsihed 1%" "finished 2%" and etc how can i just update percentage x% without printing a new line? and i want to open two console windows one show messages one show the process as above. how do i open another console ...

deallocating memory for objects I haven't set to null

EDIT: Problem wasn't related to the question. It was indeed something wrong with my code, and actually, it was so simple that I don't want to put it on the internet. Thanks anyway. I read in roughly 550k Active directory records and store them in a List, the class being a simple wrapper for an AD user. I then split the list of ADRecords...

Pauses between commands in simple console C# app

Is there any easy how to e.g. have 1 second delay between commands? I can only think of some large cycles. I know about thread.sleep but it is not what I am looking for - I would like to just use something else without relation to threads. Thanks for any idea ...