为什么(string)int32总是抛出:无法将类型'int'转换为'string'
public class Foo
{
private int FooID;
public Foo()
{
FooID = 4;
string s = (string)FooID; //throws compile error
string sss = FooID.ToString(); //no compile error
}
}
Run Code Online (Sandbox Code Playgroud)