共用方式為


IPassportManager::HasProfile

IPassportManager::HasProfile

Determines whether a user has core profile data available.

Syntax

HRESULT HasProfile (
  VARIANT ProfileName, 
  VARIANT_BOOL* pVal
);

Parameters

  • ProfileName
    [in, optional] A VARIANT (should be VT_BSTR) naming the profile to check for. The only valid value for this parameter is "core". If the value "core" is used or if this parameter is left blank, this method will check for the presence of the core profile. Valid profile names are determined by the Profile schema sent to sites in the Partner.xml Component Configuration Document (CCD).
  • pVal
    [out, retval] A pointer to a VARIANT Boolean value. Returns VARIANT_TRUE if the requested profile exists for the incoming request; otherwise, VARIANT_FALSE. If no such profile named in ProfileName exists, pVal always returns VARIANT_FALSE.

For information about how to call methods with optional VARIANT inputs, see Passing Empty Variants.

Return values

Returns one of the following values:

S_OK Success.

Remarks

IPassportManager::HasProfile returns VARIANT_TRUE if the user provided Microsoft® .NET Passport profile data on the incoming request query string or already has his or her profile stored as a cookie. IPassportManager::HasProfile will return VARIANT_FALSE if the data was not provided. If the core profile cookie is not valid in the caller's domain, then this method will return VARIANT_FALSE. Profile cookies are not inherently timestamped, but the age of the Profile cookie should be the same as the last refresh time for the matching Ticket.

After the presence of a valid Profile has been affirmed, the IPassportManager::get_Profile method can be used to get the values contained in the user's core profile.

See Also

IPassportManager Interface | IPassportManager::get_Profile