WebBrowser.Navigate 메서드

정의

지정된 Uri에서 문서를 비동기적으로 탐색합니다.

오버로드

Navigate(String, String, Byte[], String)

지정된 URL에서 문서를 비동기적으로 탐색하고 문서의 콘텐츠를 로드할 대상 프레임을 지정합니다. 추가 HTTP POST 데이터 및 HTTP 헤더를 서버에 탐색 요청의 일부로 보낼 수 있습니다.

Navigate(Uri, String, Byte[], String)

지정된 Uri에서 문서를 비동기적으로 탐색하고 문서의 콘텐츠를 로드할 대상 프레임을 지정합니다. 추가 HTTP POST 데이터 및 HTTP 헤더를 서버에 탐색 요청의 일부로 보낼 수 있습니다.

Navigate(String)

지정된 URL에서 문서를 비동기적으로 탐색합니다.

Navigate(Uri)

지정된 Uri에서 문서를 비동기적으로 탐색합니다.

Navigate(String, String, Byte[], String)

지정된 URL에서 문서를 비동기적으로 탐색하고 문서의 콘텐츠를 로드할 대상 프레임을 지정합니다. 추가 HTTP POST 데이터 및 HTTP 헤더를 서버에 탐색 요청의 일부로 보낼 수 있습니다.

public:
 void Navigate(System::String ^ source, System::String ^ targetFrameName, cli::array <System::Byte> ^ postData, System::String ^ additionalHeaders);
public void Navigate (string source, string targetFrameName, byte[] postData, string additionalHeaders);
member this.Navigate : string * string * byte[] * string -> unit
Public Sub Navigate (source As String, targetFrameName As String, postData As Byte(), additionalHeaders As String)

매개 변수

source
String

탐색할 URL입니다.

targetFrameName
String

문서의 콘텐츠를 표시할 프레임의 이름입니다.

postData
Byte[]

소스가 요청될 때 서버에 보낼 HTTP POST 데이터입니다.

additionalHeaders
String

소스가 요청될 때 서버에 보낼 HTTP 헤더입니다.

설명

이 메서드를 사용하여 이 Navigate(String, String, Byte[], String) 스케이프 문자를 포함할 수 있는 URL로 이동합니다. 이 메서드를 사용하여 이 Navigate(Uri, String, Byte[], String) 스케이프 문자가 포함되지 않은 항목으로 이동합니다 Uri .

적용 대상

Navigate(Uri, String, Byte[], String)

지정된 Uri에서 문서를 비동기적으로 탐색하고 문서의 콘텐츠를 로드할 대상 프레임을 지정합니다. 추가 HTTP POST 데이터 및 HTTP 헤더를 서버에 탐색 요청의 일부로 보낼 수 있습니다.

public:
 void Navigate(Uri ^ source, System::String ^ targetFrameName, cli::array <System::Byte> ^ postData, System::String ^ additionalHeaders);
public void Navigate (Uri source, string targetFrameName, byte[] postData, string additionalHeaders);
member this.Navigate : Uri * string * byte[] * string -> unit
Public Sub Navigate (source As Uri, targetFrameName As String, postData As Byte(), additionalHeaders As String)

매개 변수

source
Uri

탐색할 Uri입니다.

targetFrameName
String

문서의 콘텐츠를 표시할 프레임의 이름입니다.

postData
Byte[]

소스가 요청될 때 서버에 보낼 HTTP POST 데이터입니다.

additionalHeaders
String

소스가 요청될 때 서버에 보낼 HTTP 헤더입니다.

예외

WebBrowser 인스턴스가 더 이상 유효하지 않습니다.

기본 네이티브 WebBrowser에 대한 참조를 검색할 수 없습니다.

부분 신뢰로 실행되고 있는 애플리케이션에서

  • 원본 사이트에 없는 Uri로 탐색할 경우 또는
  • targetFrameName 이름이 null이거나 비어 있지 않은 경우

예제

다음 예제에서는 "about:blank" 대상을 지정하여 문서로 이동하여 새 브라우저 창에서 문서를 여는 방법을 보여 있습니다.

<StackPanel>  
    <StackPanel Orientation="Horizontal">  
        <TextBox x:Name="addressTextBox" Width="200" />  
        <Button Click="goNavigateButton_Click">Go</Button>  
    </StackPanel>  
    <WebBrowser x:Name="myWebBrowser" />  
</StackPanel>  
private void goNavigateButton_Click(object sender, RoutedEventArgs e)  
{  
    // Get URI to navigate to  
    Uri uri = new Uri(this.addressTextBox.Text, UriKind.RelativeOrAbsolute);  

    // Only absolute URIs can be navigated to  
    if (!uri.IsAbsoluteUri)  
    {  
        MessageBox.Show("The Address URI must be absolute. For example, 'http://www.microsoft.com'");  
        return;  
    }  

    // Navigate to the desired URL by calling the .Navigate method  
    this.myWebBrowser.Navigate(uri, "_blank", null, null);  
}  

설명

이 메서드를 사용하여 이 Navigate(String, String, Byte[], String) 스케이프 문자를 포함할 수 있는 URL로 이동합니다. 이 메서드를 사용하여 이 Navigate(Uri, String, Byte[], String) 스케이프 문자가 포함되지 않은 항목으로 이동합니다 Uri .

적용 대상

Navigate(String)

지정된 URL에서 문서를 비동기적으로 탐색합니다.

public:
 void Navigate(System::String ^ source);
public void Navigate (string source);
member this.Navigate : string -> unit
Public Sub Navigate (source As String)

매개 변수

source
String

탐색할 URL입니다.

설명

이 메서드를 사용하여 이 Navigate(String) 스케이프 문자를 포함할 수 있는 URL로 이동합니다. 이 메서드를 사용하여 이 Navigate(Uri) 스케이프 문자를 포함하지 않는 항목으로 Uri 이동합니다.

적용 대상

Navigate(Uri)

지정된 Uri에서 문서를 비동기적으로 탐색합니다.

public:
 void Navigate(Uri ^ source);
public void Navigate (Uri source);
member this.Navigate : Uri -> unit
Public Sub Navigate (source As Uri)

매개 변수

source
Uri

탐색할 Uri입니다.

예외

WebBrowser 인스턴스가 더 이상 유효하지 않습니다.

기본 네이티브 WebBrowser에 대한 참조를 검색할 수 없습니다.

부분 신뢰로 실행되고 있는 애플리케이션에서 원본 사이트에 없는 Uri로 탐색할 경우

예제

다음 예제에서는 메서드를 사용하여 WebBrowser Navigate(Uri) 문서로 이동하는 방법을 보여줍니다.

<StackPanel>  
    <StackPanel Orientation="Horizontal">  
        <TextBox x:Name="addressTextBox" Width="200" />  
        <Button Click="goNavigateButton_Click">Go</Button>  
    </StackPanel>  
    <WebBrowser x:Name="myWebBrowser" />  
</StackPanel>  
private void goNavigateButton_Click(object sender, RoutedEventArgs e)  
{  
    // Get URI to navigate to  
    Uri uri = new Uri(this.addressTextBox.Text, UriKind.RelativeOrAbsolute);  

    // Only absolute URIs can be navigated to  
    if (!uri.IsAbsoluteUri)  
    {  
        MessageBox.Show("The Address URI must be absolute. For example, 'http://www.microsoft.com'");  
        return;  
    }  

    // Navigate to the desired URL by calling the .Navigate method  
    this.myWebBrowser.Navigate(uri);  
}  

설명

호출 Navigate(Uri) 은 속성 설정과 동일한 영향을 미칩니다 Source . Source는 초기화 시점 WebBrowser 으로 이동하는 초기 문서를 선언적으로 지정하려는 개발자가 WebBrowser 태그에서 사용됩니다.

이 메서드를 사용하여 이 Navigate(String) 스케이프 문자를 포함할 수 있는 URL로 이동합니다. 이 메서드를 사용하여 이 Navigate(Uri) 스케이프 문자를 포함하지 않는 항목으로 Uri 이동합니다.

적용 대상