共用方式為


UrlBuilder.BuildUrl 方法

定義

建立 UI,以建立或挑選 URL。

多載

BuildUrl(IComponent, Control, String, String, String)

建立 UI,以建立或挑選 URL。

BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 物件,建立 UI 以建立或選取 URL。

BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 物件,建立 UI 以建立或選取 URL。

BuildUrl(IComponent, Control, String, String, String)

建立 UI,以建立或挑選 URL。

public:
 static System::String ^ BuildUrl(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter);
public static string BuildUrl (System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter);
static member BuildUrl : System.ComponentModel.IComponent * System.Windows.Forms.Control * string * string * string -> string
Public Shared Function BuildUrl (component As IComponent, owner As Control, initialUrl As String, caption As String, filter As String) As String

參數

component
IComponent

IComponent 的站台是用來存取設計階段服務。

owner
Control

當做選擇器視窗父代 (Parent) 使用的 Control

initialUrl
String

要顯示於 [選擇器] 視窗中的初始 URL。

caption
String

[選擇器] 視窗的標題。

filter
String

篩選條件字串,用來選擇性地篩選顯示於選擇器視窗中的檔案。

傳回

從 UI 傳回的 URL。

範例

下列程式碼範例示範如何使用 BuildUrl 方法,在設計階段從功能表命令啟動 URL 產生器。

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl( this->Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions::None );
// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            
                
    // Launch the Url Builder using the specified control
    // parent, initial URL, empty relative base URL path,
    // window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl(
        this.Component, 
        c, 
        "http://www.example.com", 
        "Select a URL", 
        "", 
        UrlBuilderOptions.None);                      
}
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()

    ' Launch the Url Builder using the specified control
    ' parent, initial URL, empty relative base URL path,
    ' window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl( _
        Me.Component, _
        c, _
        "http://www.example.com", _
        "Select a URL", _
        "", _
        UrlBuilderOptions.None)
End Sub

另請參閱

適用於

BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 物件,建立 UI 以建立或選取 URL。

public:
 static System::String ^ BuildUrl(System::ComponentModel::IComponent ^ component, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter, System::Web::UI::Design::UrlBuilderOptions options);
public static string BuildUrl (System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);
static member BuildUrl : System.ComponentModel.IComponent * System.Windows.Forms.Control * string * string * string * System.Web.UI.Design.UrlBuilderOptions -> string
Public Shared Function BuildUrl (component As IComponent, owner As Control, initialUrl As String, caption As String, filter As String, options As UrlBuilderOptions) As String

參數

component
IComponent

IComponent 的站台是用來存取設計階段服務。

owner
Control

當做選擇器視窗父代 (Parent) 使用的 Control

initialUrl
String

要顯示於 [選擇器] 視窗中的初始 URL。

caption
String

[選擇器] 視窗的標題。

filter
String

篩選條件字串,用來選擇性地篩選顯示於選擇器視窗中的檔案。

options
UrlBuilderOptions

UrlBuilderOptions,表示 URL 選取的選項。

傳回

從 UI 傳回的 URL。

範例

// Create a parent control.
System::Windows::Forms::Control^ c = gcnew System::Windows::Forms::Control;
c->CreateControl();

// Launch the Url Builder using the specified control
// parent, initial URL, empty relative base URL path,
// window caption, filter String* and URLBuilderOptions value.
UrlBuilder::BuildUrl( this->Component, c, "http://www.example.com", "Select a URL", "", UrlBuilderOptions::None );
// This method handles the "Launch Url Builder UI" menu command.
// Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
private void launchUrlBuilder(object sender, EventArgs e)
{
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            
                
    // Launch the Url Builder using the specified control
    // parent, initial URL, empty relative base URL path,
    // window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl(
        this.Component, 
        c, 
        "http://www.example.com", 
        "Select a URL", 
        "", 
        UrlBuilderOptions.None);                      
}
' This method handles the "Launch Url Builder UI" menu command.
' Invokes the BuildUrl method of the System.Web.UI.Design.UrlBuilder.
Private Sub launchUrlBuilder(ByVal sender As Object, ByVal e As EventArgs)
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()

    ' Launch the Url Builder using the specified control
    ' parent, initial URL, empty relative base URL path,
    ' window caption, filter string and URLBuilderOptions value.
    UrlBuilder.BuildUrl( _
        Me.Component, _
        c, _
        "http://www.example.com", _
        "Select a URL", _
        "", _
        UrlBuilderOptions.None)
End Sub

另請參閱

適用於

BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions)

使用指定的 UrlBuilderOptions 物件,建立 UI 以建立或選取 URL。

public:
 static System::String ^ BuildUrl(IServiceProvider ^ serviceProvider, System::Windows::Forms::Control ^ owner, System::String ^ initialUrl, System::String ^ caption, System::String ^ filter, System::Web::UI::Design::UrlBuilderOptions options);
public static string BuildUrl (IServiceProvider serviceProvider, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);
static member BuildUrl : IServiceProvider * System.Windows.Forms.Control * string * string * string * System.Web.UI.Design.UrlBuilderOptions -> string
Public Shared Function BuildUrl (serviceProvider As IServiceProvider, owner As Control, initialUrl As String, caption As String, filter As String, options As UrlBuilderOptions) As String

參數

serviceProvider
IServiceProvider

要用來存取設計階段服務的 IServiceProvider

owner
Control

當做選擇器視窗父代 (Parent) 使用的 Control

initialUrl
String

要顯示於 [選擇器] 視窗中的初始 URL。

caption
String

[選擇器] 視窗的標題。

filter
String

篩選條件字串,用來選擇性地篩選顯示於選擇器視窗中的檔案。

options
UrlBuilderOptions

UrlBuilderOptions,表示 URL 選取的選項。

傳回

從 UI 傳回的 URL。

備註

介面 IServiceProvider 是用來取得 IDesignerHost 設計工具主機的實作。

另請參閱

適用於