@@ -1223,11 +1223,11 @@ The URI formed by combining <paramref name="baseUri" /> and <paramref name="rela
1223
1223
1224
1224
## Examples
1225
1225
The following example writes the host name (`www.contoso.com`) and port number (8080) of the server to the console.
1226
-
1227
- [! code- cpp[Classic Uri.Authority Example#1]( ~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.Authority Example/CPP/source.cpp#1)]
1228
- [! code- csharp[Classic Uri.Authority Example#1]( ~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Authority Example/CS/source.cs#1)]
1229
- [! code-vb[Classic Uri.Authority Example#1]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic Uri.Authority Example/VB/source.vb#1)]
1230
-
1226
+
1227
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.Authority Example/CPP/source.cpp" id="Snippet1":::
1228
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Authority Example/CS/source.cs" interactive="try-dotnet-method" id="Snippet1":::
1229
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic Uri.Authority Example/VB/source.vb" id="Snippet1":::
1230
+
1231
1231
]]> </format >
1232
1232
</remarks >
1233
1233
<exception cref =" T:System.InvalidOperationException" >This instance represents a relative URI, and this property is valid only for absolute URIs.</exception >
@@ -1338,10 +1338,10 @@ The URI formed by combining <paramref name="baseUri" /> and <paramref name="rela
1338
1338
## Examples
1339
1339
The following example checks whether the host name is valid.
1340
1340
1341
- [! code- cpp[Classic Uri.CheckHostName Example#1]( ~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CPP/source.cpp#1)]
1342
- [! code- csharp[Classic Uri.CheckHostName Example#1]( ~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CS/source.cs#1)]
1343
- [! code-vb[Classic Uri.CheckHostName Example#1]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/VB/source.vb#1)]
1344
-
1341
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CPP/source.cpp" id="Snippet1":::
1342
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/CS/source.cs" interactive="try-dotnet-method" id="Snippet1":::
1343
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic Uri.CheckHostName Example/VB/source.vb" id="Snippet1":::
1344
+
1345
1345
]]> </format >
1346
1346
</remarks >
1347
1347
</Docs >
@@ -1618,10 +1618,10 @@ If you used an escaped string to construct this instance (for example, `"http://
1618
1618
1619
1619
## Examples
1620
1620
The following example creates a <xref:System.Uri> instance from a string. It illustrates the difference between the value returned from <xref:System.Uri.Host%2A>, which returns the host name or address specified in the URI, and the value returned from <xref:System.Uri.DnsSafeHost%2A>, which returns an address that is safe to use in DNS resolution.
1621
-
1622
- [! code- cpp[NCLUriEnhancements#4]( ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriEnhancements/CPP/nclurienhancements.cpp#4)]
1623
- [! code- csharp[NCLUriEnhancements#4]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriEnhancements/CS/nclurienhancements.cs#4)]
1624
- [! code-vb[NCLUriEnhancements#4]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriEnhancements/VB/nclurienhancements.vb#4)]
1621
+
1622
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriEnhancements/CPP/nclurienhancements.cpp" id="Snippet4":::
1623
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriEnhancements/CS/nclurienhancements.cs" interactive="try-dotnet-method" id="Snippet4":::
1624
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriEnhancements/VB/nclurienhancements.vb" id="Snippet4":::
1625
1625
1626
1626
As explained in Remarks, unescape the host name before resolving it. You can use the <xref:System.Uri.UnescapeDataString%2A> method to unescape the host name, and you can resolve it by calling the <xref:System.Net.Dns.GetHostEntry%2A> method.
1627
1627
@@ -1979,11 +1979,11 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
1979
1979
1980
1980
## Examples
1981
1981
The following example creates a <xref:System.Uri> instance and writes the fragment information to the console.
1982
-
1983
- [! code- cpp[NCLUriExamples#4]( ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#4)]
1984
- [! code- csharp[NCLUriExamples#4]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#4)]
1985
- [! code-vb[NCLUriExamples#4]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#4)]
1986
-
1982
+
1983
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet4":::
1984
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet4":::
1985
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet4":::
1986
+
1987
1987
]]> </format >
1988
1988
</remarks >
1989
1989
<exception cref =" T:System.InvalidOperationException" >This instance represents a relative URI, and this property is valid only for absolute URIs.</exception >
@@ -2872,10 +2872,10 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
2872
2872
## Examples
2873
2873
The following example creates a <xref:System.Uri> instance and determines whether it is a file URI.
2874
2874
2875
- [! code- cpp[NCLUriExamples#6]( ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#6)]
2876
- [! code- csharp[NCLUriExamples#6]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#6)]
2877
- [! code-vb[NCLUriExamples#6]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#6)]
2878
-
2875
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet6":::
2876
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" id="Snippet6":::
2877
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet6":::
2878
+
2879
2879
]]> </format >
2880
2880
</remarks >
2881
2881
<exception cref =" T:System.InvalidOperationException" >This instance represents a relative URI, and this property is valid only for absolute URIs.</exception >
@@ -3415,11 +3415,11 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
3415
3415
3416
3416
## Examples
3417
3417
The following example creates 2 <xref:System.Uri> instances. The difference in the path information is written to the console.
3418
-
3419
- [! code- cpp[NCLUriExamples#3]( ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#3)]
3420
- [! code- csharp[NCLUriExamples#3]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#3)]
3421
- [! code-vb[NCLUriExamples#3]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#3)]
3422
-
3418
+
3419
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet3":::
3420
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet3":::
3421
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet3":::
3422
+
3423
3423
]]> </format >
3424
3424
</remarks >
3425
3425
<exception cref =" T:System.ArgumentNullException" >
@@ -3830,11 +3830,11 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
3830
3830
3831
3831
## Examples
3832
3832
The following example writes the URI port number to the console. In this case, the value is the default port number for HTTP, port 80.
3833
-
3834
- [! code- cpp[Classic Uri.Port Example#1]( ~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.Port Example/CPP/source.cpp#1)]
3835
- [! code- csharp[Classic Uri.Port Example#1]( ~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs#1)]
3836
- [! code-vb[Classic Uri.Port Example#1]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic Uri.Port Example/VB/source.vb#1)]
3837
-
3833
+
3834
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/Classic Uri.Port Example/CPP/source.cpp" id="Snippet1":::
3835
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/Classic Uri.Port Example/CS/source.cs" interactive="try-dotnet-method" id="Snippet1":::
3836
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic Uri.Port Example/VB/source.vb" id="Snippet1":::
3837
+
3838
3838
]]> </format >
3839
3839
</remarks >
3840
3840
<exception cref =" T:System.InvalidOperationException" >This instance represents a relative URI, and this property is valid only for absolute URIs.</exception >
@@ -4203,10 +4203,10 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
4203
4203
## Examples
4204
4204
The following example creates a new <xref:System.Uri> instance from a string. It illustrates the difference between the value returned from <xref:System.Uri.OriginalString%2A>, which returns the string that was passed to the constructor, and from a call to <xref:System.Uri.ToString%2A>, which returns the canonical form of the string.
4205
4205
4206
- [! code- cpp[NCLUriExamples#7]( ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#7)]
4207
- [! code- csharp[NCLUriExamples#7]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#7)]
4208
- [! code-vb[NCLUriExamples#7]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#7)]
4209
-
4206
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet7":::
4207
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet7":::
4208
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet7":::
4209
+
4210
4210
]]> </format >
4211
4211
</remarks >
4212
4212
</Docs >
@@ -4494,8 +4494,8 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
4494
4494
## Examples
4495
4495
The following code example unescapes a URI, and then converts any plus characters ("+") into spaces.
4496
4496
4497
- [! code- csharp[NCLUriExamples#19]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#19)]
4498
-
4497
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet19":::
4498
+
4499
4499
]]> </format >
4500
4500
</remarks >
4501
4501
<exception cref =" T:System.ArgumentNullException" >
@@ -4728,11 +4728,11 @@ The length of <paramref name="stringToEscape" /> exceeds 32766 characters.</exce
4728
4728
4729
4729
## Examples
4730
4730
The following example creates a <xref:System.Uri> instance and determines whether the scheme is <xref:System.Uri.UriSchemeHttps>.
4731
-
4732
- [! code- cpp[NCLUriExamples#16]( ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp#16)]
4733
- [! code- csharp[NCLUriExamples#16]( ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs#16)]
4734
- [! code-vb[NCLUriExamples#16]( ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb#16)]
4735
-
4731
+
4732
+ ::: code language=" cpp" source=" ~/samples/snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp" id="Snippet16":::
4733
+ ::: code language=" csharp" source=" ~/samples/snippets/csharp/VS_Snippets_Remoting/NCLUriExamples/CS/uriexamples.cs" interactive="try-dotnet-method" id="Snippet16":::
4734
+ ::: code language="vb" source=" ~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLUriExamples/VB/uriexamples.vb" id="Snippet16":::
4735
+
4736
4736
]]> </format >
4737
4737
</remarks >
4738
4738
</Docs >
0 commit comments