c# 读取资源中的字符串
To read a string from the user in C#, we use ReadLine() method of Console class.
要使用C#从用户读取字符串 ,我们使用Console类的ReadLine()方法。
Syntax:
句法:
public static string Console.ReadLine();
Here, we don't pass any parameter and this method returns a string (a next line of the characters) from the input stream or returns null if there is no line of characters in the input stream.
在这里,我们不传递任何参数,并且此方法从输入流返回一个字符串(下一行字符),或者如果输入流中没有任何行,则返回null 。
The method ReadLine() may returns following exceptions,
方法ReadLine()可能返回以下异常,
IOException: If there is an input/output exception is occurred.