Share via


IUrlHelper.IsLocalUrl(String) Metoda

Definice

Vrátí hodnotu, která označuje, zda je adresa URL místní. Adresa URL se považuje za místní, pokud nemá část hostitele nebo autority a má absolutní cestu. Adresy URL používající virtuální cesty (~/) jsou také místní.

public:
 bool IsLocalUrl(System::String ^ url);
public bool IsLocalUrl (string url);
public bool IsLocalUrl (string? url);
abstract member IsLocalUrl : string -> bool
Public Function IsLocalUrl (url As String) As Boolean

Parametry

url
String

Adresa URL.

Návraty

truepokud je adresa URL místní; v opačném případě . false

Příklady

Za místní se považují například následující adresy URL:

/Views/Default/Index.html
~/Index.html

Následující adresy URL nejsou místní:

../Index.html
http://www.contoso.com/
http://localhost/Index.html

Platí pro