Freigeben über


IUri::GetDisplayUri method

Returns a Uniform Resource Identifier (URI) that can be used for display purposes.

Syntax

HRESULT GetDisplayUri(
  [out] BSTR *pbstrDisplayString
);

Parameters

  • pbstrDisplayString [out]
    Address of a BSTR that receives the property value. Caller is responsible for freeing the memory with SysFreeString.

Return value

Returns one of the following values:

Return code Description
S_OK

Success.

S_FALSE

The property is not defined.

E_OUTOFMEMORY

There is insufficient memory to create the BSTR.

 

Remarks

IUri::GetDisplayUri was introduced in Windows Internet Explorer 7.

The display URI combines protocol scheme, fully qualified domain name, port number (if not the default for the scheme), full resource path, query string, and fragment.

Note   The display URI may have additional formatting applied to it, such that the string produced by IUri::GetDisplayUri isn't necessarily a valid URI. For this reason, and since the userinfo is not present, the display URI should be used for viewing only; it should not be used for edit by the user, or as a form of transfer for URIs inside or between applications.

 

If the scheme is known (for example, http, ftp, or file) then the display URI will hide credentials. However, if the URI uses an unknown scheme and supplies user name and password, the display URI will also contain the user name and password.

Security Warning: Storing sensitive information as clear text in a URI is not recommended. According to RFC3986: Uniform Resource Identifier (URI), Generic Syntax, Section 7.5, "A password appearing within the userinfo component is deprecated and should be considered an error except in those rare cases where the 'password' parameter is intended to be public."

This function is for convenience. It is the same as calling IUri::GetPropertyBSTR with the Uri_PROPERTY_DISPLAY_URI property and no flags.

Requirements

Minimum supported client

Windows XP with SP2

Minimum supported server

Windows Server 2003 with SP1

Product

Internet Explorer 7

Header

Urlmon.h

IDL

Urlmon.idl

DLL

Urlmon.dll

See also

IUri

IUri::GetAbsoluteUri