相关疑难解决方法(0)

try/catch + using,正确的语法

哪一个:

using (var myObject = new MyClass())
{
   try
   {
      // something here...
   }
   catch(Exception ex)
   {
      // Handle exception
   }
}
Run Code Online (Sandbox Code Playgroud)

要么

try
{
   using (var myObject = new MyClass())
   {
      // something here...
   }
}
catch(Exception ex)
{
   // Handle exception
}
Run Code Online (Sandbox Code Playgroud)

c# using-statement try-catch

178
推荐指数
7
解决办法
9万
查看次数

标签 统计

c# ×1

try-catch ×1

using-statement ×1