예제 #1
0
 /// <summary>
 /// 根据选择的模块生成不同的类型
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 private database CreateDataBase(string type)
 {
     database d = null;
     switch (type)
     {
         case "1":
             d = new dbHttpAll();
             break;
         case "2":
             d = new dbMsgAll("Msn");
             break;
         case "3":
             d = new dbMsgAll("Yahoo");
             break;
         case "4":
             d = new dbMailBox("Pop");
             break;
         case "5":
             d = new dbMailBox("Smtp");
             break;
         case "6":
             d = new dbMailSite("Get");
             break;
         case "7":
             d = new dbMailSite("Send");
             break;
         case "8":
             d = new dbInfoAll("Web");
             break;
         case "9":
             d = new dbDns();
             break;
         case "10":
             d = new dbHorse();
             break;
         case "11":
             d = new dbInfoAll("Ftp");
             break;
     }
     return d;
 }
예제 #2
0
 //导出HTTP数据
 protected void btnHttpExport_Click(object sender, EventArgs e)
 {
     DateTime dteFromDate, dteToDate;
     dteFromDate = Convert.ToDateTime(HttpStartDate.Value.ToString()).Date;
     dteToDate = Convert.ToDateTime(HttpEndDate.Value.ToString()).Date;
     dbHttpAll DB = new dbHttpAll();
     string FileName = Server.MapPath(".") + "\\temp\\" + common.GetFileName() + ".xls";
     DB.ExportToExcel(dteFromDate, dteToDate, FileName);
     SendToClient(FileName);
 }
예제 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        _RecordCount = Convert.ToInt32(lblRecordCount.Text);
        _PageCount = _RecordCount / _PageSize;
        if (_RecordCount % _PageSize > 0) _PageCount++;
        _PageIndex = Convert.ToInt32(lblPageIndex.Text);
        int selectedCount = 0;

        string sParent = "'0'";
        DB = new dbHttpAll();

        if (!IsPostBack)
        {
            dbConfig configDB = new dbConfig();
            string gUserName = configDB.getUserName(User.Identity.Name);
            string gIP = Request.ServerVariables["Remote_Addr"];
            string gContent = "网站查询";
            common.setLog(User.Identity.Name, gUserName, gIP, gContent);
            formInit();
        }
        else
        {
            switch (qrytypelist.SelectedItem.Value)
            {
                case "0"://自选时间段
                    Condition += "vTime > '" + Convert.ToDateTime(sdate.Value.ToString()).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + Convert.ToDateTime(edate.Value.ToString()).AddDays(1).ToString("yyyy-MM-dd") + "'";
                    break;
                case "1"://前三天
                    Condition += "vTime > '" + DateTime.Today.AddDays(-3).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
                case "2"://前一周
                    Condition += "vTime > '" + DateTime.Today.AddDays(-7).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
                case "3"://前一月
                    Condition += "vTime > '" + DateTime.Today.AddMonths(-1).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
                case "5"://昨天
                    Condition += "vTime > '" + DateTime.Today.AddDays(-1).ToString("yyyy-MM-dd") + "'";
                    Condition += " and vTime < '" + DateTime.Today.ToString("yyyy-MM-dd") + "'";
                    break;
            }

            //获取选中的服务器
            foreach (ListItem li in cblHost.Items)
            {
                if (li.Selected)
                {
                    sParent += "," + li.Value + "";
                    selectedCount++;
                }
            }

            //tedi3231 added 2010.02.01 没有选中任何站点时显示用户能看到的所有站点
            if (sParent.Length <= 3)
            {
                sParent = common.GetHosrList(User.Identity.Name);
            }

            if (selectedCount < cblHost.Items.Count)
                Condition += " and nParent in (" + sParent + ")";
            if (txtSrcAddr.Text.ToString() != "")
                Condition += " and vSrcAddr = dmc_config.dbo.[f_IP2int]('" + txtSrcAddr.Text.ToString() + "')";
            if (txtSrcMac.Text.ToString() != "")
                Condition += " and vSrcMac = '" + txtSrcMac.Text.ToString() + "'";
            if (txtWeburl.Text.ToString() != "")
            {
                if (weburleq.Checked)
                    Condition += " and vURL = '" + txtWeburl.Text.ToString() + "'";
                else
                    Condition += " and vURL like '%" + txtWeburl.Text.ToString().Trim() + "%'";
            }
            if (txtWebIP.Text.ToString() != "")
                Condition += " and vDstAddr = dmc_config.dbo.[f_IP2int]('" + txtWebIP.Text.ToString() + "')";

            int senstive = common.GetSenstiveCheck(this.CheckBoxList2);

            if (senstive > 0)
                Condition += " and ( (nKey & " + senstive + ")>0 ) ";

            // 条件传给存储过程的时候,最前面不需要跟上and
            if (!string.IsNullOrEmpty(Condition) && Condition.Length > 4 && Condition.Substring(0, 5) == " and ")
                Condition = Condition.Substring(5);
        }
    }
예제 #4
0
 //删除HTTP数据
 protected void btnHttpDelete_Click(object sender, EventArgs e)
 {
     DateTime dteFromDate, dteToDate;
     dteFromDate = Convert.ToDateTime(HttpStartDate.Value.ToString()).Date;
     dteToDate = Convert.ToDateTime(HttpEndDate.Value.ToString()).Date;
     dbHttpAll DB = new dbHttpAll();
     DB.DelTables(dteFromDate, dteToDate);
 }