HtmlWindow.Document プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HtmlWindow.Document プロパティの意味・解説 

HtmlWindow.Document プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ウィンドウ格納されている HTML ドキュメント取得します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim instance As HtmlWindow
Dim value As HtmlDocument

value = instance.Document
public HtmlDocument Document { get; }
public:
property HtmlDocument^ Document {
    HtmlDocument^ get ();
}
/** @property */
public HtmlDocument get_Document ()

プロパティ
ドキュメント読み込まれている場合は、HtmlDocument の有効なインスタンス。このウィンドウFRAMESET格納しているか、現在読み込まれているドキュメントない場合は、null 参照 (Visual Basic では Nothing) を返します

解説解説
使用例使用例

フレームを含むページ内のドキュメント調べ今後調査使用するために、各ページから張られているすべてのハイパーリンクの表を作成するコード例次に示します

Dim LinksTable As Hashtable

Private Sub GetLinksFromFrames()
    LinksTable = New Hashtable()
    Dim FrameUrl As String

    If (Not WebBrowser1.Document Is
 Nothing) Then
        With WebBrowser1.Document
            Dim CurrentWindow As HtmlWindow
 = .Window
            If (CurrentWindow.Frames.Count > 0) Then
                For Each Frame As
 HtmlWindow In CurrentWindow.Frames
                    FrameUrl = Frame.Url.ToString()
                    Dim FrameLinksHash As New
 Hashtable()
                    LinksTable.Add(FrameUrl, FrameLinksHash)

                    For Each HrefElement As
 HtmlElement In Frame.Document.Links
                        FrameLinksHash.Add(HrefElement.GetAttribute("HREF"),
 "Url")
                    Next
                Next
            Else
                Dim DocLinksHash As New
 Hashtable()
                LinksTable.Add(.Url.ToString(), DocLinksHash)

                For Each HrefElement As
 HtmlElement In .Links
                    DocLinksHash.Add(HrefElement.GetAttribute("HREF"),
 "Url")
                Next
            End If
        End With
    End If
End Sub
private void GetLinksFromFrames()
{
    Hashtable linksTable = new Hashtable();
    string frameUrl;

    if (!(webBrowser1.Document == null))
    {
        HtmlWindow currentWindow = webBrowser1.Document.Window;
        if (currentWindow.Frames.Count > 0)
        {
            foreach (HtmlWindow frame in currentWindow.Frames)
            {
                frameUrl = frame.Url.ToString();
                Hashtable frameLinksHash = new Hashtable();

                linksTable.Add(frameUrl, frameLinksHash);
                foreach (HtmlElement hrefElement in
 frame.Document.Links)
                {
                    frameLinksHash.Add(hrefElement.GetAttribute("HREF"),
 "Url");
                }
            }
        }
        else
        {
            Hashtable docLinksHash = new Hashtable();
            linksTable.Add(webBrowser1.Document.Url.ToString(), docLinksHash);

            foreach (HtmlElement hrefElement in
 webBrowser1.Document.Links)
            {
                docLinksHash.Add(hrefElement.GetAttribute("HREF"), "Url");
            }
        }
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からHtmlWindow.Document プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHtmlWindow.Document プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHtmlWindow.Document プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

HtmlWindow.Document プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HtmlWindow.Document プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS