在我们教授的示例代码中,有一段代码片段如下:
if (name == null || name == "")
throw new ArgumentException("name is null or empty");
And another snippet that looks like this:
if (!File.Exists(name))
{
throw new Exception("File does not exist!");
}
我只是想知道两者的区别以及为什么要使用其中之一