Skip to Main Content
C# Cookbook, 2nd Edition
book

C# Cookbook, 2nd Edition

by Jay Hilyard, Stephen Teilhet
January 2006
Intermediate to advanced content levelIntermediate to advanced
1184 pages
43h 23m
English
O'Reilly Media, Inc.
Content preview from C# Cookbook, 2nd Edition
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
168
|
Chapter 3: Classes and Structures
Discussion
Before command-line parameters can be parsed, a common format must first be
decided upon. The format for this recipe follows the command-line format for the
Visual C# .NET language compiler. The format used is defined as follows:
All command-line arguments are separated by one or more whitespace
characters.
• Each argument may start with either a - or / character, but not both. If it does
not, that argument is considered a literal, such as a filename.
Each argument that starts with either the - or / character may be divided up into
a switch followed by a colon followed by one or more arguments separated with
the ; character. The command-line parameter
-sw:arg1;arg2;arg3 is divided up
into a switch (
sw) and three arguments (arg1, arg2, and arg3). Note that there
should not be any spaces in the full argument; otherwise, the runtime command-
line parser will split up the argument into two or more arguments.
{
DisplayErrorMsg("");
}
public virtual void DisplayErrorMsg(string msg)
{
Console.WriteLine
("An error occurred while processing the command-line arguments:");
Console.WriteLine(msg);
Console.WriteLine( );
FileVersionInfo version =
Process.GetCurrentProcess( ).MainModule.FileVersionInfo;
if (Process.GetCurrentProcess( ).ProcessName.Trim( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C# Cookbook

C# Cookbook

Stephen Teilhet, Jay Hilyard
C# Cookbook

C# Cookbook

Joe Mayo
Head First C#, 4th Edition

Head First C#, 4th Edition

Andrew Stellman, Jennifer Greene

Publisher Resources

ISBN: 0596100639Supplemental ContentCatalog PageErrata