二战狙击枪最远射程:ASP.NET开发报错(请看问题补充)

来源:百度文库 编辑:神马品牌网 时间:2024/05/05 07:11:55
Server Error in '/dotNet2' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'int' does not contain a definition for 'FromString'

Source Error:

Line 13: bool ServerValidate(Object source,String value)
Line 14: {
Line 15: int num=Int32.FromString(value);
Line 16: if(num%2==0)
Line 17: return true;

上面的错误是如何引起的?如何解决?谢谢

int num=Int32.FromString(value);

改成

int num = Int32.Parse(value);

或者

int num = Convert.ToInt32(value);

right,
int num = Convert.ToInt32(value);