可能重複:
Direct casting vs 'as' operator?
Casting vs using the 'as' keyword in the CLR「object as type」和「((type)object)」有什麼區別?
object myObject = "Hello world.";
var myString = myObject as string;
object myObject = "Hello world.";
var myString = (string)myObject;
我見過的類型轉換這兩種方式。有什麼不同?
看到我關於這個問題的文章:http://blogs.msdn.com/b/ericlippert/archive/2009/10/08/what-s-the-difference-between-as-and-cast-operators。 aspx –