日期:2014-05-17 浏览次数:20878 次
class Program
{
static void Main(string[] args)
{
Test t = new Test();
string str1 = t.ReadString1();
Console.WriteLine(str1);
string str2 = t.ReadString2();
Console.WriteLine(str2);
Console.ReadLine();
}
}
class Test
{
public string ReadString2()
{
Console.WriteLine("我是DoWork");
return "DoW";
}
public string ReadString1()
{
string str1 = string.Empty;
try
{
if (string.IsNullOrWhiteSpace(str1))
{
throw new Exception("The value is null!");
}
}
catch(Exception e)
{
Console.WriteLine(e.Message);
}
return str1;
}
}