指定したスキーム、ホスト、ポート番号、パス、およびクエリ文字列またはフラグメント識別子を使用して、UriBuilder クラスの新しいインスタンスを初期化します。
名前空間: System
アセンブリ: System (system.dll 内)
構文
'宣言
Public Sub New ( _
scheme As String, _
host As String, _
port As Integer, _
path As String, _
extraValue As String _
)
'使用
Dim scheme As String
Dim host As String
Dim port As Integer
Dim path As String
Dim extraValue As String
Dim instance As New UriBuilder(scheme, host, port, path, extraValue)
public UriBuilder (
string scheme,
string host,
int port,
string path,
string extraValue
)
public:
UriBuilder (
String^ scheme,
String^ host,
int port,
String^ path,
String^ extraValue
)
public UriBuilder (
String scheme,
String host,
int port,
String path,
String extraValue
)
public function UriBuilder (
scheme : String,
host : String,
port : int,
path : String,
extraValue : String
)
パラメータ
- scheme
インターネット アクセス プロトコル。
- host
DNS スタイルのドメイン名、または IP アドレス。
- port
このサービスの IP ポート番号。
- path
インターネット リソースへのパス。
- extraValue
クエリ文字列またはフラグメント識別子。
例外
例外の種類 | 条件 |
---|---|
extraValue が、null 参照 (Visual Basic では Nothing)、Empty、シャープ記号 (#) で始まる有効なフラグメント識別子、疑問符 (?) で始まる有効なクエリ文字列のいずれでもありません。 |
|
port が 0 未満です。 |
解説
UriBuilder インスタンスは、Scheme プロパティを schemeName に、Host プロパティを hostName に、Port プロパティを portNumber に、および Path プロパティを pathValue にそれぞれ設定して、初期化されます。extraValue がシャープ記号 (#) で始まる場合には、Fragment が extraValue に設定されます。extraValue が疑問符 (?) で始まる場合には、Query が extraValue に設定されます。
使用例
https://www.contoso.com:8080/index.htm\#top という URI を含む UriBuilder インスタンスを作成する例を次に示します。
Dim myUri As New UriBuilder("http", "www.contoso.com", 8080, "index.htm", "#top")
UriBuilder myUri = new UriBuilder("http","www.contoso.com",8080,"index.htm","#top");
UriBuilder^ myUri = gcnew UriBuilder( "http","www.contoso.com",8080,"index.htm","#top" );
UriBuilder myUri = new UriBuilder("http", "www.contoso.com",
8080, "index.htm", "#top");
プラットフォーム
Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 2.0、1.1、1.0