UrlBuilder.BuildUrl 方法

定义

创建用于创建或选取 URL 的 UI。

重载

名称 说明
BuildUrl(IComponent, Control, String, String, String)

创建用于创建或选取 URL 的 UI。

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

使用指定的 UrlBuilderOptions 对象创建用于创建或选取 URL 的 UI。

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

使用指定的 UrlBuilderOptions 对象创建用于创建或选取 URL 的 UI。

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

创建用于创建或选取 URL 的 UI。

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

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 对象创建用于创建或选取 URL 的 UI。

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

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 对象创建用于创建或选取 URL 的 UI。

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

Control用作选取器窗口的父级。

initialUrl
String

要显示在选取器窗口中的初始 URL。

caption
String

选取器窗口的标题。

filter
String

用于选择性地筛选选取器窗口中显示的文件的筛选器字符串。

options
UrlBuilderOptions

指示 UrlBuilderOptions URL 选择的选项。

返回

从 UI 返回的 URL。

注解

IServiceProvider 接口用于获取 IDesignerHost 设计器主机的实现。

另请参阅

适用于