Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C# 4.0 and .NET 4
This is the forum to discuss the Wrox book Professional C# 4.0 and .NET 4 by Christian Nagel, Bill Evjen, Jay Glynn, Karli Watson, Morgan Skinner; ISBN: 9780470502259
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C# 4.0 and .NET 4 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 14th, 2013, 03:51 PM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 1 Main() Method

Hello, I am somewhat of a beginner, but I have not had too much trouble understanding this book until this section:

For Chapter 1 - Section "The Main() Method" - the following sample code is provided at the end:

Quote:
using System;

namespace Wrox
{
class ArgsExample
{
public static int Main(string[] args)
{
for (int i = 0; i < args.Length; i++)
{
Console.WriteLine(args[i]);
}
return 0;
}
}
}
Then it says:
Quote:
You can compile this as usual using the command line. When you run the compiled executable, you can pass in arguments after the name of the program, as shown in this example:


ArgsExample /a /b /c
/a
/b
/c
However I don't know what "command line" refers to, or where I would input "the name of the program". I have tried using the Windows Command Prompt, as well as the Command Window in Visual Studio, using various commands found on MSDN, and can't make heads or tails of this. Any hints on how to open an executable while passing parameters to its main function as shown above (unless I have misunderstood what the author is saying) would be greatly appreciated.

Before this section, I was just running compiled executables by double-clicking on them in my files. ***Edit: I did it this way because of error CS1619 received in the Visual Studio 2010 Command Prompt because I did not have administrator privileges on the machine I was using.

Thank you for your help.

Last edited by klwint02; August 15th, 2013 at 10:11 AM.
Reply With Quote
  #2 (permalink)  
Old August 15th, 2013, 09:20 AM
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Found Solution

I know this is basic stuff, but in case anyone else has the same question, I figured this out after a fresh look at it this morning with the help of the following MSDN pages:

http://msdn.microsoft.com/en-us/library/hh781607.aspx
http://msdn.microsoft.com/en-us/library/96s74eb0.aspx

You can enter arguments into the "Command line arguments" text box in Visual Studio 2010, which can be found by going to Project => Properties and selecting Debug in the project window.

Last edited by klwint02; August 15th, 2013 at 10:12 AM.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 19 Main.Masterpage vlmeyers BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 1 June 25th, 2012 11:32 PM
Main function at chapter 6, pages 330-331 Johnson BOOK: Ivor Horton's Beginning Visual C++ 2010 1 November 29th, 2010 04:46 PM
Instance of same class in main method ajit Java Basics 1 July 1st, 2006 06:26 PM
Missing Sub Main in Chapter One, Exercise One mmcdonal BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 6 October 27th, 2004 06:06 PM
Main Method CodeMonkeys C# 1 August 11th, 2004 06:51 AM



All times are GMT -4. The time now is 03:29 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.