ProfileProvider.DeleteProfiles 方法

定義

從資料來源刪除設定檔屬性和資訊。

多載

DeleteProfiles(String[])

在衍生類別中覆寫時,會針對符合提供的使用者名稱清單之設定檔,刪除這些設定檔的屬性和資訊。

DeleteProfiles(ProfileInfoCollection)

在衍生類別中覆寫時,會針對提供的設定檔清單,刪除這些設定檔的屬性和資訊。

DeleteProfiles(String[])

在衍生類別中覆寫時,會針對符合提供的使用者名稱清單之設定檔,刪除這些設定檔的屬性和資訊。

public:
 abstract int DeleteProfiles(cli::array <System::String ^> ^ usernames);
public abstract int DeleteProfiles (string[] usernames);
abstract member DeleteProfiles : string[] -> int
Public MustOverride Function DeleteProfiles (usernames As String()) As Integer

參數

usernames
String[]

字串陣列,包含要刪除的設定檔之使用者名稱。

傳回

從資料來源中刪除的設定檔數目。

範例

下列程式碼範例顯示 方法實作的方法 DeleteProfiles 簽章。 如需完整 ProfileProvider 實作的範例,請參閱 如何:建置和執行設定檔提供者範例

public override int DeleteProfiles(string[] usernames)
{
    return 0;
}
Public Overrides Function DeleteProfiles(ByVal usernames As String()) As Integer
  Return 0
End Function

備註

方法 DeleteProfiles 會刪除 參數中指定的 usernames 設定檔。 只會移除組態檔中指定的 資料 applicationName

另請參閱

適用於

DeleteProfiles(ProfileInfoCollection)

在衍生類別中覆寫時,會針對提供的設定檔清單,刪除這些設定檔的屬性和資訊。

public:
 abstract int DeleteProfiles(System::Web::Profile::ProfileInfoCollection ^ profiles);
public abstract int DeleteProfiles (System.Web.Profile.ProfileInfoCollection profiles);
abstract member DeleteProfiles : System.Web.Profile.ProfileInfoCollection -> int
Public MustOverride Function DeleteProfiles (profiles As ProfileInfoCollection) As Integer

參數

profiles
ProfileInfoCollection

ProfileInfoCollection,包含要刪除的設定檔資訊。

傳回

從資料來源中刪除的設定檔數目。

範例

下列程式碼範例顯示 方法實作的方法 DeleteProfiles 簽章。 如需完整 ProfileProvider 實作的範例,請參閱 如何:建置和執行設定檔提供者範例

public override int DeleteProfiles(ProfileInfoCollection profiles)
{
    return 0;
}
Public Overrides Function DeleteProfiles(ByVal profiles As ProfileInfoCollection) As Integer
  Return 0
End Function

備註

方法 DeleteProfiles 會刪除 參數中指定的 profiles 設定檔。 只會移除組態檔中指定的 資料 applicationName

在衍生類別中實作這個方法時,您可以使用 applicationName 所提供的 中每個 ProfileInfo 物件的 值和 UserName 屬性,以判斷要從資料來源 ProfileInfoCollection 中刪除的設定檔。

另請參閱

適用於