Exemple #1
0
        public void ShowSource()
        {
            Wait();
            string clean   = wBrowser.DocumentText;
            int    bodyidx = clean.IndexOf("<body>");

            if (bodyidx < 0)
            {
                bodyidx = clean.IndexOf("<BODY>");
            }

            if (bodyidx < 0)
            {
                MessageBox.Show(FindForm(),
                                LangPack.TranslateString("Nothing found"),
                                Constants.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            clean = clean.Substring(0, bodyidx);
            HtmlSourceViewForm form = new HtmlSourceViewForm();

            form.Source = clean + WebBrowserHelper.GetDocument(wBrowser).Body.OuterHtml + "\r\n</html>";
            form.Text   = wBrowser.Url.ToString();
            form.Show();
        }
        public void ShowSource()
        {
            Wait();
            string clean = wBrowser.DocumentText;
            int bodyidx = clean.IndexOf("<body>");
            if(bodyidx < 0)
                bodyidx = clean.IndexOf("<BODY>");

            if(bodyidx < 0)
            {
                MessageBox.Show(FindForm(),
                    LangPack.TranslateString("Nothing found"),
                    Constants.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            clean = clean.Substring(0, bodyidx);
            HtmlSourceViewForm form = new HtmlSourceViewForm();
            form.Source = clean + WebBrowserHelper.GetDocument(wBrowser).Body.OuterHtml + "\r\n</html>";
            form.Text = wBrowser.Url.ToString();
            form.Show();
        }