473,586 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a 'console application'

C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?

I'd want something with a simple menu system as well as popup functionality.

Any hints/pointers to get me started?

Marco
Dec 29 '06 #1
3 7262
Hi,

I know of nothing like that, at least for .net

why would you like something like that?

"Marco Shaw" <marcoDOTshaw_@ _gmailDOTcomwro te in message
news:%2******** *********@TK2MS FTNGP06.phx.gbl ...
C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?

I'd want something with a simple menu system as well as popup
functionality.

Any hints/pointers to get me started?

Marco

Dec 29 '06 #2
He Marco... The answer is "of course." :-) I hate to sound like an old dude
but frankly that's how we used to write apps. I wrote DOS apps (probably
some still in use) by writing the library code for the form, menu, buttons
and other controls first. The user could drag "windows" around the DOS
screen, control background colors, play sounds and all that good stuff.

In the extreme form the fanciest UI's were called "games." :-) Consider if
they could write DOOM without the Windows GUI you must be able to generate a
text-based menu system. As you point out, EDIT still works, if it wasn't
possible then it shouldn't work.
"Marco Shaw" <marcoDOTshaw_@ _gmailDOTcomwro te in message
news:%2******** *********@TK2MS FTNGP06.phx.gbl ...
C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?

I'd want something with a simple menu system as well as popup
functionality.

Any hints/pointers to get me started?

Marco

Dec 30 '06 #3
On Fri, 29 Dec 2006 15:29:24 -0400, "Marco Shaw"
<marcoDOTshaw_@ _gmailDOTcomwro te:
>C# novice...

Can I create a console application (think the Pine email reader or even
'edit' in DOS) where I can use my up/down/side arrows to move around the
app?
Yes.
>Any hints/pointers to get me started?

Marco
Use elements of Console for the cursor moving bit: CursorTop,
CursorLeft, KeyInfo, ConsoleKey, KeyAvailable and Read(). You may
also need System.Threadin g.Thread.Sleep( ) to wait for a key to be
pressed.

I don't know how much of a hint you want, but don't read any further
if you don't want to see a very simple demonstration.

rossum



static void Main() {
string twentyDots = new string('.', 20);

for (int i = 0; i < 10; ++i) {
Console.WriteLi ne(twentyDots);
} // end for
Console.WriteLi ne("Use arrow keys to move or X to exit.");

// Initial position of cursor
Console.CursorL eft = 9;
Console.CursorT op = 4;

// Loop to read keyboard
bool finished = false;
ConsoleKeyInfo keyInfo = new ConsoleKeyInfo( );
do {
// Wait until key is pressed.
while (Console.KeyAva ilable == false) {
Thread.Sleep(10 0);
} // end while

// 'true' stops key echo.
keyInfo = Console.ReadKey (true);
switch (keyInfo.Key) {
case ConsoleKey.Down Arrow:
++Console.Curso rTop;
break;
case ConsoleKey.Left Arrow:
--Console.CursorL eft;
break;
case ConsoleKey.Righ tArrow:
++Console.Curso rLeft;
break;
case ConsoleKey.UpAr row:
--Console.CursorT op;
break;
case ConsoleKey.X:
finished = true;
break;
default:
break;
} // end switch
} while (!finished);
} // end Main()


Dec 30 '06 #4

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

Similar topics

0
518
by: soundchaser | last post by:
I'm looking for a simple but complete example of creating a VB.Net ActiveX / COM component from a C Library. One should be able to use it by calling the Server.CreateObject method from an ASP script. I have already figured out how to do most of it, but I'm stumped on the part where I call it from an ASP script. Assume I have a VS.Net...
4
2121
by: Raed Sawalha | last post by:
I'm trying to create Element as following name MyElement:InitialName XmlElement elem = doc.CreateElement("MyElement:InitialName"); when generate the XML the tag is truncated as ONLY "MyElement",why? Any Suggestions
15
6735
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use javascript or vbscript it works. I will appreciate any help. I do the following (C#):
12
1960
by: Mark | last post by:
Hello, in a simple console application I try to create a file with some code like: FileStream file = new FileStream("test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new StreamWriter(file); sw.Write("Hello"); sw.Close(); file.Close();
9
6002
by: Rotzooi | last post by:
Hi, I have a VB.NET Service application that's running fine under the Local System account. But for configuration purposes I don't want to be dependent on modifying the registry manually or using an seperate application (like I do now). I want to implement a system tray icon when someone logs on to the console. I've tried several samples...
0
1085
by: Lemune | last post by:
Hello everyone. I'm creating windows service application to capture data from my PABX, and send the data to sql server. My question is how could my application know when that PABX is sending data and not? I get really confused here. Please check my code and give me some idea or clue or help please :). Thanks in advance. My code is like this:...
12
6518
by: Noam | last post by:
I had originally written a program as a c# console application. The program used a reference that I wrote in c++. Later I was told to re-write the application as a windows service. When the service would start up, as soon as it accessed the reference (by instantiating a class within the reference), the service would crash. In the event viewer...
1
1819
by: twdo | last post by:
OK. I am totally frustrated here. I have a setup project within Visual Studio. That setup project is calling a class library project by the use of Custom Actions. Within that class library (my "helper" project), I have an installer class. That class is called by Install, Uninstall, Rollback, etc. I am only using Install and Uninstall. During...
1
2767
by: DarkGiank | last post by:
Hi, im new to csharp and im trying to create a class that can change the application database without no rewriting all connection code... but cause some reason it is not working... it tells me that im not creating the object but im doing it,,, please help im a newbie to c# using System; using System.Collections.Generic; using System.Text;...
0
7912
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8202
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8338
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8216
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6614
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5710
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5390
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3837
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.