问题描述
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;///<summary>///Class1的摘要说明///</summary>publicclassClass1{publicClass1();publicclassUser{privatestringusername;privatestringpassword;publicUser(){}publicstringUsername{get{returnusername;}set{username=value;}}publicstringPassWord{get{returnpassword;}set{password=value;}}}}错误1“Class1.Class1()”必须声明主体,因为它未标记为abstract、extern或partial请高手帮我看看,谢谢!
解决方案
解决方案二:
//这样试试publicclassClass1{publicClass1(){}//加上{}publicclassUser{privatestringusername;privatestringpassword;publicUser(){}publicstringUsername{get{returnusername;}set{username=value;}}publicstringPassWord{get{returnpassword;}set{password=value;}}}}
解决方案三:
木有构造函数诶
解决方案四:
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;publicpartialclass_Default:System.Web.UI.Page{publicclassClass1{publicClass1(){}publicclassUser{privatestringusername;privatestringpassword;publicUser(){}publicstringUsername{get{returnusername;}set{username=value;}}publicstringPassWord{get{returnpassword;}set{password=value;}}}}}