.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 16th, 2004, 06:26 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 64
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
C# user input

Ok, this is probably very simple! but how do you get user input from a console window. I've been looking though learning C# and i just cant find anything at all. I was thinking something to do with System.Console or System.IO but .

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #2  
Old February 16th, 2004, 09:37 AM
lazy_yogi lazy_yogi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 325 lazy_yogi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 58 m 36 sec
Reputation Power: 7
Hey Mark

This is a great tutorial
http://www.softsteel.co.uk/tutorials/cSharp/cIndex.html

This is also great, a bit more in depth – so some obvious stuff that you’ll need to skim over, but explains some new concepts in a little more depth.
http://www.csharp-station.com/Tutorial.aspx

This is also great – the M$ one
http://msdn.microsoft.com/library/d...rpSpecStart.asp

Code:
Console.WriteLine("Enter your name");
string s7 = Console.ReadLine();
Console.WriteLine("Hello, {0}!", s7);

Reply With Quote
  #3  
Old February 17th, 2004, 06:02 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 11 m 13 sec
Reputation Power: 64
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Thanks Yogi, works perfectly! I'll give the tutorials a good reading a little latter

Mark.

Reply With Quote
  #4  
Old April 2nd, 2008, 09:53 AM
Themagicalrock Themagicalrock is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 Themagicalrock User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 7 sec
Reputation Power: 0
Ok, that was really helpful, but what if i wanted there to be an int value or a number. What is the code for that?

Reply With Quote
  #5  
Old April 2nd, 2008, 10:09 AM
f'lar's Avatar
f'lar f'lar is offline
Senior WeyrLeader
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Aug 2003
Location: WI
Posts: 4,130 f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level)f'lar User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 11 h 49 m 55 sec
Reputation Power: 977
Send a message via Google Talk to f'lar
Always read from the console as a string. Then use Typname.Parse() or Typename.TryParse() to convert that to your desired type. For example, if you want an integer it would be Integer.Parse. A Decimal would be Decimal.Parse. Same for a Datetime. You can also use Convert.ToTypename() for more exotic types.
__________________
Primary Forums: .Net Development, MS-SQL, C Programming
VB.Net: It's not your father's Visual Basic.

[Moving to ASP.Net] | [.Net Dos and Don't for VB6 Programmers]

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > C# user input


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT