private void tabs_SelectedIndexChanged(object sender, EventArgs e) { if (curdb == null) { return; } //hex tab always loaded pict.Image = null; wb.Navigate2(ref blankUrl); string tmp = ""; if (tabs.SelectedTab.Text == "TextView") { rtf.Text = curdb.GetBody(); } if (tabs.SelectedTab.Text == "ImageView") { tmp = curdb.BinaryBodyToTmpFile(); try { pict.Load(tmp); File.Delete(tmp); } catch (Exception ex) { }; } if (tabs.SelectedTab.Text == "WebView") { Object oTmp = (Object)curdb.BinaryBodyToTmpFile(); try { wb.Navigate2(ref oTmp); /*File.Delete((string)oTmp);*/ } catch (Exception ex) { }; } }
private void searchContentBodyToolStripMenuItem_Click(object sender, EventArgs e) { pb.Value = 0; pb2.Value = 0; int i = 0, j = 0; string match = InputBox("Search for"); if (match.Length == 0) { return; } FrmList fl = new FrmList(); fl.parent = this; fl.lv.Items.Clear(); foreach (TreeNode n in tv.Nodes) { i++; setpb(i, tv.Nodes.Count, 1); n.Checked = false; foreach (TreeNode nn in n.Nodes) { j++; setpb(j, n.Nodes.Count, 2); nn.Checked = false; DataBlock db = (DataBlock)nn.Tag; if (db.LoadData()) { string body = db.HttpHeader + "\r\n\r\n" + db.GetBody(); if (body.IndexOf(match, StringComparison.CurrentCultureIgnoreCase) > 0) { string txt = db.HttpFirstLine; if (txt.Length == 0) { txt = "Data: " + body.Length.ToString(); } setNodeColor(nn, 1); setNodeColor(n, 2); nn.Checked = true; ListViewItem li2 = fl.lv.Items.Add(txt); li2.Tag = nn; } db.FreeData(); } } } pb.Value = 0; pb2.Value = 0; fl.Show(); }