试试:try
        {
        你的代码
        }
      catch (Exception e)
        {
         MessageBox.Show(e.Message);
        }