C#中抛出异常的方法,C#中可以通过throw抛出一个指定的异常
private void DoProcess(string value)
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentNullException("value","parameter value cannot be null");
}
}
C#中抛出异常的方法,C#中可以通过throw抛出一个指定的异常
private void DoProcess(string value)
{
if (string.IsNullOrEmpty(value))
{
throw new ArgumentNullException("value","parameter value cannot be null");
}
}