簡體   English   中英

System.Windows.Forms.HtmlDocument不包含GetElementByID的定義

[英]System.Windows.Forms.HtmlDocument does not contain a definition for GetElementByID

你能解釋一下我收到這個錯誤的原因嗎?

    private void startButton_Click(object sender, EventArgs e)
    {
        HtmlElement mainNav = webBrowser1.Document.GetElementByID("home");
            mainNav.InvokeMember("click");
    }

錯誤1

'System.Windows.Forms.HtmlDocument' does not contain a definition for 'GetElementByID' and no extension method 'GetElementByID' accepting a first argument of type 'System.Windows.Forms.HtmlDocument' could be found (are you missing a using directive or an assembly reference?)

因為它是GetElementById ,小寫'd'。

文檔位於: http//msdn.microsoft.com/en-us/library/system.windows.forms.htmldocument.getelementbyid.aspx


附注:在system.windows.forms.htmldocument上的Google搜索讓我直接檢查文檔,Intellisense也應該能夠告訴你正確的拼寫。 我確實意識到它有時需要額外的一雙眼睛。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM