HtmlDocument.DomDocument Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the unmanaged interface pointer for this HtmlDocument.
public:
property System::Object ^ DomDocument { System::Object ^ get(); };
public object DomDocument { get; }
member this.DomDocument : obj
Public ReadOnly Property DomDocument As Object
Property Value
An Object representing an IDispatch
pointer to the unmanaged document.
Examples
The following code example casts the DomDocument to an IHTMLDocument2
pointer and displays the value of the lastModified
property, which tells when the owner of the document last updated its contents. The code example requires that you have a Button on your form named Button6
.
private string GetLastModifiedDate()
{
if (webBrowser1.Document != null)
{
MSHTML.IHTMLDocument2 currentDoc = (MSHTML.IHTMLDocument2)webBrowser1.Document.DomDocument;
return (currentDoc.lastModified);
}
else
{
return ("");
}
}
Private Function GetLastModifiedDate() As String
If (Not (WebBrowser1.Document Is Nothing)) Then
Dim CurrentDocument As MSHTML.IHTMLDocument2 = WebBrowser1.Document.DomDocument
GetLastModifiedDate = CurrentDocument.lastModified
Else
GetLastModifiedDate = Nothing
End If
End Function
Remarks
HtmlDocument is a wrapper for the Internet Explorer Document Object Model (DOM), which is written in COM. If you need to access unexposed properties or methods on the underlying COM interfaces, such as IHTMLDocument2
, you can use this object to query for them.
To use the unmanaged interfaces, import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the IDispatch::Invoke
method.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기