共用方式為


UriHelper.BuildRelative 方法

定義

將指定的 URI 元件結合成正確編碼以用於 HTTP 標頭的字串。

public static string BuildRelative (Microsoft.AspNetCore.Http.PathString pathBase = default, Microsoft.AspNetCore.Http.PathString path = default, Microsoft.AspNetCore.Http.QueryString query = default, Microsoft.AspNetCore.Http.FragmentString fragment = default);
static member BuildRelative : Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.PathString * Microsoft.AspNetCore.Http.QueryString * Microsoft.AspNetCore.Http.FragmentString -> string
Public Function BuildRelative (Optional pathBase As PathString = Nothing, Optional path As PathString = Nothing, Optional query As QueryString = Nothing, Optional fragment As FragmentString = Nothing) As String

參數

pathBase
PathString

與應用程式根目錄相關聯的要求路徑的第一個部分。

path
PathString

識別所要求資源的要求路徑部分。

query
QueryString

查詢,如果有的話。

fragment
FragmentString

如果有的話,片段。

傳回

合併的 URI 元件,正確編碼以用於 HTTP 標頭。

適用於