ASP.NET技巧:请求网址并解析返回的html(2)

  3、定义ClassInfo类(课程类),用CodeSmith生成

 public class ClassInfo
    {
        Member Variables#region Member Variables
        protected string _loginDate;
        protected string _logoutDate;
        protected string _registerDate;
        protected string _useMin;
        protected string _className;
        protected string _classType;
        protected string _percent;
        //protected string _nouse;
        #endregion
        Constructors#region Constructors
        public ClassInfo() { }
        public ClassInfo(string loginDate, string logoutDate, string registerDate, string useMin, string className, string classType, string percent)
        {
            this._loginDate = loginDate;
            this._logoutDate = logoutDate;
            this._registerDate = registerDate;
            this._useMin = useMin;
            this._className = className;
            this._classType = classType;
            this._percent = percent;
        }
        #endregion
        Public Properties#region Public Properties
        //        public string NoUse
        //        {
        //            get{return _nouse;}
        //            set{ _nouse= value;}
        //        }
        public string LoginDate
        {
            get { return _loginDate; }
            set { _loginDate = value; }
        }
        public string LogoutDate
        {
            get { return _logoutDate; }
            set { _logoutDate = value; }
        }
        public string RegisterDate
        {
            get { return _registerDate; }
            set { _registerDate = value; }
        }
        public string UseMin
        {
            get { return _useMin; }
            set { _useMin = value; }
        }
        public string ClassName
        {
            get { return _className; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for ClassName", value, value.ToString());
                _className = value;
            }
        }
        public string ClassType
        {
            get { return _classType; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for ClassType", value, value.ToString());
                _classType = value;
            }
        }
        public string Percent
        {
            get { return _percent; }
            set
            {
                if (value != null && value.Length > 50)
                    throw new ArgumentOutOfRangeException("Invalid value for Percent", value, value.ToString());
                _percent = value;
            }
        }
        #endregion
    }

 

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjfsyw.html