看板 C_Sharp 關於我們 聯絡資訊
if (dr[i].GetType() == System.DateTime) { } 我的判斷是只要是DataTime就要獨立抓出來,請問這語法要怎麼寫? 寫System.DateTime 會 compile error -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 125.228.55.124 (臺灣) ※ 文章網址: https://www.ptt.cc/bbs/C_Sharp/M.1658571811.A.518.html
sating00: typeof() 07/23 20:54
iterator: 用 if (dr[i] is System.DateTime) 07/25 09:23
iterator: C# 7 以後,還有 swtich (dr[i]) case DateTime dt1: 07/25 09:23