473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

anybody hold a sample of C# project for design a console based application?

Kee
Dear All

I need a sample working under console using C#, basically it should
looks like utilities under console support pipe and redirect operation.

May I seek your help to send me a completed project/library sample of
that pls?
Regards
Kee
Sep 19 '08 #1
4 1695
How about:

class Program {
static void Main() {
System.Console.WriteLine("Hello world");
}
}

and:
csc my.cs

That seems to fit the bill...?
Sep 19 '08 #2
Kee
Marc Gravell wrote:
How about:

class Program {
static void Main() {
System.Console.WriteLine("Hello world");
}
}

and:
csc my.cs

That seems to fit the bill...?
Hi Marc

Thanks for your class sample, however, it is a bit beyond what I needs ,
it is partly because I need the application working in cygwin enviroment
and co-work with unix utility.

So, a command option parser and a class adapter with the basic "stdin"
"stdout" and "stderr" is prefered.
Kee
Sep 20 '08 #3

"Kee" <ke*******@gmail.comwrote in message
news:gb**********@news.cn99.com...
Marc Gravell wrote:
>How about:

class Program {
static void Main() {
System.Console.WriteLine("Hello world");
}
}

and:
csc my.cs

That seems to fit the bill...?

Hi Marc

Thanks for your class sample, however, it is a bit beyond what I needs ,
it is partly because I need the application working in cygwin enviroment
and co-work with unix utility.

So, a command option parser and a class adapter with the basic "stdin"
"stdout" and "stderr" is prefered.
Kee
Without knowing what command parsing means to you, here is an expanded
example using stdin, stdout and stderr. Of course you should check the
argument count before using it.

class Program {
static void Main() {
System.Console.Out.WriteLine("Arg [1]: " +
Environment.GetCommandLineArgs() [1]);
System.Console.WriteLine("Hello world");
System.Console.Error.WriteLine("Hello, stderr");
string input = System.Console.In.ReadLine();
}
}

Sep 20 '08 #4
As "Family Tree Mike" notes, System.Console *is* a wrapper for stdin,
stdout and stderr, and as-such has full support for any redirection
offered to those pipes by the host OS. In the lack of any more
detailed requirements, writing "Hello World" to stdout seemed a
sensible starter...

Marc
Sep 21 '08 #5

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

Similar topics

1
by: Rog | last post by:
Hello, Yesterday I downloaded IEwebcontrols.exe and TreeviewControl.msi from http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnaspp/html/aspnet-...
1
by: Scott Haner via DotNetMonster.com | last post by:
Hey; I've done a decent amount of VB.net in University, but the next stage for a major project we have been asked to use 'modulization' and that the judges want to see as much code and functions...
11
by: chopsnsauce | last post by:
Here's the example: Dim frm As New FORM1 Try frm.show Catch ex As Exception msgbox ex.message
1
by: Andrzej J. Turowicz | last post by:
I create new WebSite named UseWebPart ( sample from Ms Press Book) next steps: Add WebPartManagerIO , WebPartZone, EditorZone & CatalogZone, etc etc etc if i am running this sample under...
0
by: thjwong | last post by:
I'm using WinXP with Microsoft Visual C++ .NET 69462-006-3405781-18776, Microsoft Development Environment 2003 Version 7.1.3088, Microsoft .NET Framework 1.1 Version 1.1.4322 SP1 Most developers...
11
by: John Fly | last post by:
I'm working on a large project(from scratch). The program is essentially a data file processor, the overall view is this: A data file is read in, validated and stored in a memory structure...
3
by: Ubergeek | last post by:
I have a project (Win32 application) that I want to change to a console application. Does anyone know what to edit in which file, to implement the change?
10
by: AG | last post by:
I am trying to use a ReportViewer control in a VS 2005 web application project (not Website project). When I try to create a new report (local), I can't seem to find any method to create a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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
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,...

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.