[問題] try , catch 找系統問題
用 try 和 catch 找系統bug問題
(1)如果我現在輸入的資料格式是錯誤的,就顯示 Bad input!
我在 catch 那邊寫
catch(這邊要怎麼寫?)
{
Console.WriteLine("Bad input!");
}
這樣寫 show 不出來 Bad input! 資訊.... @@
(2)如果只要顯示系統錯誤訊息,下面這樣就應該可以了吧
catch(System.Exception error)
{
Console.WriteLine(error.Message);
}
PS:對於 catch() 裡面的寫法還不是很了解
--
因看板太多不可能逐一觀看
麻煩各位回覆文章的時候也請順便回覆到我的信箱
http://blog.xuite.net/kingtw1978/blog
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 70.173.83.247
推
10/09 14:27, , 1F
10/09 14:27, 1F
推
10/14 16:26, , 2F
10/14 16:26, 2F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章