HtmlTextWriter.WriteUrlEncodedString(String, Boolean) HtmlTextWriter.WriteUrlEncodedString(String, Boolean) HtmlTextWriter.WriteUrlEncodedString(String, Boolean) HtmlTextWriter.WriteUrlEncodedString(String, Boolean) Method

定義

寫入指定的字串,並根據 URL 需求來為此字串編碼。Writes the specified string, encoding it according to URL requirements.

protected:
 void WriteUrlEncodedString(System::String ^ text, bool argument);
protected void WriteUrlEncodedString (string text, bool argument);
member this.WriteUrlEncodedString : string * bool -> unit
Protected Sub WriteUrlEncodedString (text As String, argument As Boolean)

參數

text
String String String String

要編碼及寫入輸出資料流中的字串。The string to encode and write to the output stream.

argument
Boolean Boolean Boolean Boolean

如要將此字串編碼為 URL 的一部分參數區段時為 true,將此字串編碼為 URL 的一部分路徑區段時則為 falsetrue to encode the string as a part of the parameter section of the URL; false to encode the string as part of the path section of the URL.

備註

argument %xx如果ASCII%uxxxx碼小於128, x方法會將可視為 URL 分隔符號(相依于的設定)的字元編碼成格式的字串; 否則為,其中是WriteUrlEncodedString十六進位數位。The WriteUrlEncodedString method encodes characters that could be considered URL delimiters (dependent on the setting of argument) into strings of the form %xx, if the ASCII code is less than 128; otherwise, %uxxxx, where x is a hexadecimal digit.

和方法會使用WriteUrlEncodedString方法做為公用程式方法。 WriteEncodedUrlParameter WriteEncodedUrlThe WriteEncodedUrl and WriteEncodedUrlParameter methods use the WriteUrlEncodedString method as a utility method.

適用於

另請參閱