473,499 Members | 1,660 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Console Input Capture in Class Library

Hello world

I have a console application that loads several classes. I would like on of my classes to be able to detect input made in the console and take action based on the input. Sounds simple but of course in my class library I can't see the Console object. Anybody know how to do this

Thanks

Derek
Nov 22 '05 #1
5 1638
> Sounds simple but of course in my class library I can't see the Console
object.

Why not? Should be able to just call Console.Read or ReadLine as normal.
Are you getting some error?

--
William Stacey, MVP
Nov 22 '05 #2
> Sounds simple but of course in my class library I can't see the Console
object.

Why not? Should be able to just call Console.Read or ReadLine as normal.
Are you getting some error?

--
William Stacey, MVP
Nov 22 '05 #3
That is the weirdest part. I don't get an error. In the IDE the
debugger just skips to the end of the function when I call
Console.ReaLine

string line = System.Console.ReadLine(); Exits here
char[] input = line.ToCharArray(); this never executes

No error message thrown. Basically I want to capture input so I can
shut down or pause the app if the user inputs certain characters.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 22 '05 #4
That is the weirdest part. I don't get an error. In the IDE the
debugger just skips to the end of the function when I call
Console.ReaLine

string line = System.Console.ReadLine(); Exits here
char[] input = line.ToCharArray(); this never executes

No error message thrown. Basically I want to capture input so I can
shut down or pause the app if the user inputs certain characters.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 22 '05 #5
That is the weirdest part. I don't get an error. In the IDE the
debugger just skips to the end of the function when I call
Console.ReaLine

string line = System.Console.ReadLine(); Exits here
char[] input = line.ToCharArray(); this never executes

No error message thrown. Basically I want to capture input so I can
shut down or pause the app if the user inputs certain characters.


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
105740
by: Dave | last post by:
Hi, I have done some research, trying to Clear The Screen in java code. The first option was the obv: system.out.print("\n\n\n\n\n\n\n\n\n\n\n\n"); then i heard about this method:...
16
2645
by: Chris Maloof | last post by:
Hello, Does anyone know how I can read the ASCII text from a console window (from another application) in WinXP? It doesn't sound like a major operation, but although I can find the window via...
2
2559
by: Hugh McLaughlin | last post by:
Hello everyone and thanks for your help in advance. I am working on an application to track visitors to my website. However, I am confused as to what data to capture for the session, specifically...
4
302
by: Derek Strickland | last post by:
Hello world I have a console application that loads several classes. I would like on of my classes to be able to detect input made in the console and take action based on the input. Sounds...
1
5348
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
6
4693
by: JM | last post by:
Hi, I need a function for a character based program (console) that works exactly like the INKEY$() function in (old) QBasic: Read only 1 keystroke and then move on. Console.Read;...
12
3725
by: Jarod_24 | last post by:
I got a project called "Forms" that hold some forms and stuff in my solution. A argument at startup defines wether to use a From or Console. My plan was to create a myConsole class that would...
10
6285
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
2
14318
by: SriBhargav | last post by:
Hi, I've a question on setting timeout on console.readline() I would like the user to input something through Console.readline() in 5 secs. If there is no input in that time, I would like to...
27
2931
by: CarlosMB | last post by:
Hello, I am writing code that uses a DLL which is supposed to print to console some useful information but for some reason it is not doing so. The environment is a bit complex to explain but...
0
7014
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3108
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.