Example #1
0
        private void RecordPageUrl(string pageID, Session oSession)
        {
            string Key        = pageID;
            string Url        = this.GetRealUrl(oSession.oRequest.headers["Referer"]);
            string CreateDate = TimeFormat.GetTimeStamp();

            InjectionListManager.Instance().AddRecord(Url, Key, CreateDate);

            // dispath create new html log event
            RosinCreate(this, new EventArgs());
        }
Example #2
0
        private void UpdateFileList()
        {
            int index = this.pageListBox.SelectedIndex;

            if (index >= 0 && index < InjectionListManager.Instance().PageList.Count)
            {
                this.fileListBindingSource.DataSource = InjectionListManager.Instance().PageList[index].FileItemList;
                this.fileListBox.DisplayMember        = "CreateDateString";
                this.fileListBox.ValueMember          = "Key";
                this.fileListBox.DataSource           = this.fileListBindingSource;
            }
        }
Example #3
0
        private void InitPageList()
        {
            this.pageListBindingSource.DataSource = InjectionListManager.Instance().PageList;

            this.pageListBox.DisplayMember = "Url";
            this.pageListBox.ValueMember   = "Url";
            this.pageListBox.DataSource    = this.pageListBindingSource;

            //日志级别
            this.logLevelBindingSource.DataSource = this.logLevel;
            this.logLevelComboBox.DataSource      = this.logLevelBindingSource;

            this.UpdateFileList();
        }
Example #4
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (this.sCurrentPageKey == "")
            {
                return;
            }

            this.logRichTextBox.Clear();
            this.oLocalData.Clear();

            InjectionListManager.Instance().DelRecord(this.sCurrentPageKey);

            this.fileListBindingSource.ResetBindings(true);
            this.LoadNewLogText();
        }
Example #5
0
        /**
         * 加载日志的全部文本
         */
        private void LoadNewLogText()
        {
            int index = this.pageListBox.SelectedIndex;

            if (index < 0 || index >= InjectionListManager.Instance().PageList.Count)
            {
                return;
            }

            int fileIndex = this.fileListBox.SelectedIndex;

            if (fileIndex < 0)
            {
                this.sCurrentPageKey = "";
                return;
            }

            this.sCurrentPageKey = this.fileListBox.SelectedValue.ToString();

            if (this.sCurrentPageKey == "")
            {
                return;
            }

            //初始化数据
            this.logFileItem.Clear();
            this.oLocalData.SetKey(this.sCurrentPageKey);
            this.logFileItem.key = this.sCurrentPageKey;
            string logStr = this.oLocalData.GetAll();

            //将当前显示的日志反序列化到内存中
            DeserializeLog(logStr, false);

            if (this.logLevelComboBox.SelectedValue == null)
            {
                showLog(String.Empty);
            }
            else
            {
                showLog(this.logLevelComboBox.SelectedValue.ToString());
            }
        }
Example #6
0
 public void OnBeforeUnload()
 {
     InjectionRuleManager.Instance().SaveRule();
     InjectionListManager.Instance().SaveRecord();
 }