UrlBuilder.BuildUrl 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建用户界面以创建或选取 URL。
重载
BuildUrl(IComponent, Control, String, String, String) |
创建用户界面以创建或选取 URL。 |
BuildUrl(IComponent, Control, String, String, String, UrlBuilderOptions) |
使用指定的 UrlBuilderOptions 对象创建用户界面以创建或选取 URL。 |
BuildUrl(IServiceProvider, Control, String, String, String, UrlBuilderOptions) |
使用指定的 UrlBuilderOptions 对象创建用户界面以创建或选取 URL。 |
BuildUrl(IComponent, Control, String, String, String)
创建用户界面以创建或选取 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。
- initialUrl
- String
要在选择器窗口中显示的初始 URL。
- caption
- String
选择器窗口的标题。
- filter
- String
筛选字符串,用于有选择地筛选显示在选择器窗口中的文件。
返回
从用户界面中返回的 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。
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。
- initialUrl
- String
要在选择器窗口中显示的初始 URL。
- caption
- String
选择器窗口的标题。
- filter
- String
筛选字符串,用于有选择地筛选显示在选择器窗口中的文件。
- options
- UrlBuilderOptions
指示 URL 选择的选项的 UrlBuilderOptions。
返回
从用户界面中返回的 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。
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。
- initialUrl
- String
要在选择器窗口中显示的初始 URL。
- caption
- String
选择器窗口的标题。
- filter
- String
筛选字符串,用于有选择地筛选显示在选择器窗口中的文件。
- options
- UrlBuilderOptions
指示 URL 选择的选项的 UrlBuilderOptions。
返回
从用户界面中返回的 URL。
注解
接口 IServiceProvider 用于获取 IDesignerHost 设计器主机的 实现。