C# - failed parse exception?

后端 未结 10 1316
春和景丽
春和景丽 2021-02-19 07:35

I am writing a program in C#, and I want to catch exceptions caused by converting \"\" (null) to int. What is the exception\'s name?

EDIT: I\'m not sur

10条回答
  •  走了就别回头了
    2021-02-19 07:49

    You're probably looking to get a System.InvalidCastException, although I think that'll depend on how you try to perform the conversion.

    That said, wouldn't it be quicker/easier to simply write the code and try it yourself? Particularly as you haven't specified how you'll be performing the conversion.

提交回复
热议问题