473,796 Members | 2,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1719
How about:

class Program {
static void Main() {
System.Console. WriteLine("Hell o 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("Hell o 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*******@gmai l.comwrote in message
news:gb******** **@news.cn99.co m...
Marc Gravell wrote:
>How about:

class Program {
static void Main() {
System.Console. WriteLine("Hell o 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.Get CommandLineArgs () [1]);
System.Console. WriteLine("Hell o 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
1718
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- usingtreeviewiewebcontrol.asp
1
1075
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 as possible in DLL Files. Essentially my question is that I have no clue how this works, I want to be able to have my Main Project with a Form or whatever CALL a procedure, even if as an example the Procedure is just a Console.Writeline from a...
11
5600
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
1425
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 VisualStudio 2005 IDE all modes ( Browse, Design, Edit, Catalog ) are operational. Next step, configure WebSita (Users from Lan, anonymous)
0
2033
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 said to me that they have no problem doing that, but the following project file is said to be corrupted while opening in the IDE, it is the project file of NT xemacs BETA 21.5.24, http://ftp.xemacs.org/pub/beta/xemacs-21.5.24.tar.gz (under the...
11
2364
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 similar to a database or XML representation. Rules to modify the stored data will be executed, then the data will be transformed into an output format. Think something similar to FormatA -> XML -> Manipulate XML -> FormatB
3
1970
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
3767
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 datasource. I would like to use an existing class object. The examples I have found state that the class should be in the App_Code folder. However a WAP does not have an App_Code folder. Is there any way to specify a datasource for a local report in a...
0
9680
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10455
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10173
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9052
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7547
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6788
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5573
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2925
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.