C#转换选项,除语法之外是否有区别?
这个问题在这里已经有了答案:
如果类型不匹配,第一个将抛出InvalidCastException (请参阅文档 - “显式转换”部分)。 第二个( as运算符)会生成null值。
上一篇: C# cast options, is there any difference other than syntax?
这个问题在这里已经有了答案:
如果类型不匹配,第一个将抛出InvalidCastException (请参阅文档 - “显式转换”部分)。 第二个( as运算符)会生成null值。
上一篇: C# cast options, is there any difference other than syntax?