Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- string s;
- while ((s = Console.ReadLine()) != null)
- {
- Console.WriteLine(s);
- }
- }
- }
- public static void Main(String[] args)
- {
- String pipedText = "";
- bool isKeyAvailable;
- try
- {
- isKeyAvailable = System.Console.KeyAvailable;
- }
- catch (InvalidOperationException expected)
- {
- pipedText = System.Console.In.ReadToEnd();
- }
- //do something with pipedText or the args
- }
- public static void Main(String[] args)
- {
- String pipedText = "";
- bool isKeyAvailable;
- try
- {
- isKeyAvailable = System.Console.KeyAvailable;
- }
- catch (InvalidOperationException expected)
- {
- pipedText = System.Console.In.ReadToEnd();
- }
- //do something with pipedText or the args
- }
- while ((s = Console.ReadLine()) != null)
Add Comment
Please, Sign In to add comment