C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to pass values with out console class methods


Posted Date: 07 Sep 2008    Resource Type: Articles    Category: .NET Framework

Posted By: Sri Bhargavi       Member Level: Silver
Rating:     Points: 10



The General way of input values to a program is by using Console class methods(Console.Readline())...

We can also pass inputs to a program without using console class member, This can be done by passing command line arguments

A sample example is given here


using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;

namespace ConsoleApplication4
{
class Program
{
public void add(int a,int b)
{
Console.WriteLine( a+b);
Console.ReadLine();
}
}
class pre
{
static void Main(string[] args)
{
int a=Convert.ToInt16(args[0]);
int b = Convert.ToInt16(args[1]);
Program obj=new Program();
obj.add(a,b);

}
}
}




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Reading data without using console class.  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: String.Equal Method
Previous Resource: Reading data from CSV file
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use