// Bad object o = 1.3; try { string str = (string)o; } catch(InvalidCastException ex){...} // Good string str = o as string; if(null != str){...}
沒有留言:
張貼留言