这就是我所拥有的:
public void initiate(WebBrowser browser)
{
browser.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(refDocumentCompleted);
// navigate browser to the referal Uri
browser.Navigate(refreral);
browser.DocumentCompleted -= refDocumentCompleted;
//remove here so that it doesn't do this everytime a document is completed, i want it just in this method
}
private void refDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// want to call navigate method on browser here. but Its out of scope.
}
我想做的是,导航到referral
,然后一旦加载导航到另一个页面,该页面存储为类中的全局字符串。
我确定我的麻烦是因为对事件如何工作的理解不足,我试图阅读它,但似乎无法理解它,但我认为我不需要创建自己的处理程序.