예제 #1
0
        /// <summary>
        /// 查看源文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void 源文件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            HtmlElement elem;
            WebBrowser  wb = getCurrentBrowser();

            if (wb.Document != null)
            {
                CodeForm cf = new CodeForm();
                HtmlElementCollection elems = wb.Document.GetElementsByTagName("HTML");
                if (elems.Count == 1)
                {
                    elem    = elems[0];
                    cf.Code = elem.OuterHtml;
                    cf.Text = wb.Url.ToString() + " - 源文件";
                    cf.Show();
                }
            }
        }
예제 #2
0
 /// <summary>
 /// 查看源文件
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void 源文件ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     HtmlElement elem;
     WebBrowser wb = getCurrentBrowser();
     if (wb.Document != null)
     {
         CodeForm cf = new CodeForm();
         HtmlElementCollection elems = wb.Document.GetElementsByTagName("HTML");
         if (elems.Count == 1)
         {
             elem = elems[0];
             cf.Code = elem.OuterHtml;
             cf.Text = wb.Url.ToString() + " - 源文件";
             cf.Show();
         }
     }
 }