Esempio n. 1
0
        /// <summary>
        /// 更新状态
        /// </summary>
        public bool UpdateStatus(string spiderName, string Status)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update Mission set ");
            strSql.Append("status='" + Status + "'");
            strSql.Append(" where spidername='" + spiderName + "'");
            int rows = mshelper.UpdateSQl(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.SpiderInfo model)
        {
            string startUrl   = model.start_urls;
            string loginUrl   = model.login_url;
            string customData = model.customdata;
            string ruleData   = model.ruledatas;

            if (startUrl != "")
            {
                startUrl = model.start_urls.Replace(@"'", @"\'");
            }
            if (loginUrl != null)
            {
                loginUrl = model.login_url.Replace(@"'", @"\'");
            }
            if (customData != "")
            {
                customData = model.customdata.Replace(@"'", @"\'");
            }
            if (ruleData != "")
            {
                ruleData = model.ruledatas.Replace(@"'", @"\'");
            }
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update SpiderInfo set ");
            strSql.Append("website='" + model.website + "',files_store='" + model.file_store + "',start_urls=\"" + model.start_urls + "\",allowed_domains='" + model.allowed_domains + "',Rules='" + model.rules + "',class='" + model._class +
                          "',loader='" + model.loader + "',away='" + model.away + "',login_url=\"" + model.login_url + "\",_account='" + model.account + "',customdata='" + customData + "',cls='" + model.cls + "',ruledatas='" + ruleData + "',cookies='" + model.cookies + "'");
            strSql.Append(" where spiderName='" + model.spidername + "'");
            int rows = mshelper.UpdateSQl(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.HoneyInfo model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update HoneyInfo set ");
            strSql.Append("server='" + model.server + "',port='" + model.port + "',DBname='" + model.dbname + "',user='******',password='******',sqltype='" + model.sqltype + "'");
            strSql.Append(" where spidername='" + model.spidername + "'");
            int rows = mshelper.UpdateSQl(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 4
0
        public bool UpdateStatus(string userStatus, string userID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update user set ");
            strSql.Append("UserStatus='" + userStatus + "'");
            strSql.Append(" where UserID='" + userID + "'");
            int rows = mshelper.UpdateSQl(strSql.ToString());

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }