Прочитај на енглеском Уреди

Делите путем


UrlBuilder.BuildUrl Method

Definition

Creates a UI to create or pick a URL.

Overloads

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

Creates a UI to create or pick a URL.

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

Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

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

Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

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

Creates a UI to create or pick a URL.

C#
public static string BuildUrl(System.ComponentModel.IComponent component, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter);

Parameters

component
IComponent

The IComponent whose site is to be used to access design-time services.

owner
Control

The Control used as the parent for the picker window.

initialUrl
String

The initial URL to be shown in the picker window.

caption
String

The caption of the picker window.

filter
String

The filter string to use to optionally filter the files displayed in the picker window.

Returns

The URL returned from the UI.

Examples

The following code example shows how to use the BuildUrl method to launch a URL builder from a menu command at design time.

C#
// 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);                      
}

See also

Applies to

.NET Framework 4.8.1 и друге верзије
Производ Верзије
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

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

Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

C#
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);

Parameters

component
IComponent

The IComponent whose site is to be used to access design-time services.

owner
Control

The Control used as the parent for the picker window.

initialUrl
String

The initial URL to be shown in the picker window.

caption
String

The caption of the picker window.

filter
String

The filter string to use to optionally filter the files displayed in the picker window.

options
UrlBuilderOptions

A UrlBuilderOptions indicating the options for URL selection.

Returns

The URL returned from the UI.

Examples

C#
// 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);                      
}

See also

Applies to

.NET Framework 4.8.1 и друге верзије
Производ Верзије
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

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

Creates a UI to create or pick a URL, using the specified UrlBuilderOptions object.

C#
public static string BuildUrl(IServiceProvider serviceProvider, System.Windows.Forms.Control owner, string initialUrl, string caption, string filter, System.Web.UI.Design.UrlBuilderOptions options);

Parameters

serviceProvider
IServiceProvider

The IServiceProvider to be used to access design-time services.

owner
Control

The Control used as the parent for the picker window.

initialUrl
String

The initial URL to be shown in the picker window.

caption
String

The caption of the picker window.

filter
String

The filter string to use to optionally filter the files displayed in the picker window.

options
UrlBuilderOptions

A UrlBuilderOptions indicating the options for URL selection.

Returns

The URL returned from the UI.

Remarks

The IServiceProvider interface is used to obtain the IDesignerHost implementation for the designer host.

See also

Applies to

.NET Framework 4.8.1 и друге верзије
Производ Верзије
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1