WebBrowser.Source 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定目前託管於 Uri的文件。WebBrowser
public:
property Uri ^ Source { Uri ^ get(); void set(Uri ^ value); };
public Uri Source { [System.Security.SecurityCritical] get; set; }
public Uri Source { get; set; }
[<get: System.Security.SecurityCritical>]
member this.Source : Uri with get, set
member this.Source : Uri with get, set
Public Property Source As Uri
屬性值
目前的 HTML 文件。Uri
- 屬性
例外狀況
該 WebBrowser 實例已不再有效。
無法取得對底層原生的 WebBrowser 參考。
從部分信任執行的應用程式導航到 Uri 不在原始地點的應用程式。
範例
以下範例展示了如何僅使用標記來設定 WebBrowser HTML 文件的導航。
<!-- Web Browser Control that hosts a web page. -->
<WebBrowser x:Name="webBrowser" Source="http://msdn.com"
Width="600" Height="600" />
備註
設定來源屬性會導 WebBrowser 向 Uri由 . 若為 Uri , null則顯示空白文件(「about:blank」)。