C# 冬虫夏草;“加载框架完整”;射击次数太多了
最近刚开始修补Awesomium,它非常酷,比WinForms的库存webBrowser好得多 然而,当我使用_LoadingFrameComplete方法来确定页面是否已加载时,它似乎触发了10多次(在Facebook上使用时,在导航到google.com时触发了2次) 我正在尝试完成webBrowser1_DocumentCompleted的类似方法(在文档完成后只触发一次) 这是一个“我”的问题,还是我使用了错误的方法来检查网站是否已完全完成加载 我使用的是Visual C#2010版C# 冬虫夏草;“加载框架完整”;射击次数太多了,c#,winforms,awesomium,C#,Winforms,Awesomium,最近刚开始修补Awesomium,它非常酷,比WinForms的库存webBrowser好得多 然而,当我使用_LoadingFrameComplete方法来确定页面是否已加载时,它似乎触发了10多次(在Facebook上使用时,在导航到google.com时触发了2次) 我正在尝试完成webBrowser1_DocumentCompleted的类似方法(在文档完成后只触发一次) 这是一个“我”的问题,还是我使用了错误的方法来检查网站是否已完全完成加载 我使用的是Visual C#2010版 u
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Debugging_Problems
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string searchURL = textBox1.Text;
webControl1.Source = new Uri(searchURL);
}
private void Awesomium_Windows_Forms_WebControl_LoadingFrameComplete(object sender, Awesomium.Core.FrameEventArgs e)
{
richTextBox1.AppendText("Completed.\n");
}
}
}
尝试将if(e.IsMainFrame){….}放入LoadingFrameComplete事件处理程序中,只将代码放入其中乔恩
这就是答案。谢谢。尝试将if(e.IsMainFrame){..}放在LoadingFrameComplete事件处理程序中,只将代码放在其中。–乔恩
这就是答案。谢谢。您需要使用IsMainFrame
private void Awesomium_Windows_Forms_WebControl_LoadingFrameComplete(object sender, Awesomium.Core.FrameEventArgs e)
{
if (e.IsMainFrame)
{
richTextBox1.AppendText("Completed.\n");
}
}
您需要使用IsMainFrame
private void Awesomium_Windows_Forms_WebControl_LoadingFrameComplete(object sender, Awesomium.Core.FrameEventArgs e)
{
if (e.IsMainFrame)
{
richTextBox1.AppendText("Completed.\n");
}
}
尝试将if(e.IsMainFrame){….}放入LoadingFrameComplete事件处理程序中,只将代码放入其中。谢谢!这正是我需要知道的。万分感谢!冬虫夏草不是完全过时了吗?我已经成功使用了多年,并且定期更新。@Felix你能标记答案吗?我试过安装它,我目前正在使用2010 C#版本,在开始使用时遇到问题。可能会切换,但我需要一些自动化的东西,awesomium首先尝试将if(e.IsMainFrame){…}放入LoadingFrameComplete事件处理程序中,只将代码放入其中。谢谢!这正是我需要知道的。万分感谢!冬虫夏草不是完全过时了吗?我已经成功使用了多年,并且定期更新。@Felix你能标记答案吗?我试过安装它,我目前正在使用2010 C#版本,在开始使用时遇到问题。可能会切换,但我需要一些自动化的东西,而且awesomium在第一次尝试时就工作了