c# uri.host_C#| Uri.EscapeUriString()方法与示例
c# uri.host
Uri.EscapeUriString()方法 (Uri.EscapeUriString() Method)
Uri.EscapeUriString() method is a static method that is used to convert specified Uri string in escaped representation.
Uri.EscapeUriString()方法是一個靜態方法,用于轉換轉義表示形式中的指定Uri字符串。
Syntax:
句法:
string Uri.EscapeUriString(string StrToEsc);Parameter(s):
參數:
string StrToEsc – represents the specified Uri string to be converted in escaped format.
字符串StrToEsc –表示要以轉義格式轉換的指定Uri字符串。
Return value:
返回值:
The return type of this method is string, it returns escaped string.
此方法的返回類型為string ,它返回轉義的字符串。
Exception(s):
例外情況:
System.ArgumentNullException;System.UriFormatException;Example to demonstrate example of Uri.EscapeUriString() method
演示Uri.EscapeUriString()方法示例的示例
using System;class UriExample {//Entry point of Programstatic public void Main(){string uriString1 = "https://www.includehelp.com/index.html";string uriString2 = "https://www.includehelp.com/default.aspx";string resultString = "";resultString = Uri.EscapeUriString(uriString1);Console.WriteLine(resultString);resultString = Uri.EscapeUriString(uriString2);Console.WriteLine(resultString);} }Output
輸出量
https://www.includehelp.com/index.html https://www.includehelp.com/default.aspx翻譯自: https://www.includehelp.com/dot-net/uri-escapeuristring-method-with-example.aspx
c# uri.host
總結
以上是生活随笔為你收集整理的c# uri.host_C#| Uri.EscapeUriString()方法与示例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 超级详细的Spring Boot 注解总
- 下一篇: c#读取整数空格_C ++程序声明,读取