ProfileManager.GetNumberOfProfiles(ProfileAuthenticationOption) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
데이터 원본의 프로필 수를 가져옵니다.
public:
static int GetNumberOfProfiles(System::Web::Profile::ProfileAuthenticationOption authenticationOption);
public static int GetNumberOfProfiles(System.Web.Profile.ProfileAuthenticationOption authenticationOption);
static member GetNumberOfProfiles : System.Web.Profile.ProfileAuthenticationOption -> int
Public Shared Function GetNumberOfProfiles (authenticationOption As ProfileAuthenticationOption) As Integer
매개 변수
- authenticationOption
- ProfileAuthenticationOption
ProfileAuthenticationOption 익명, 인증된 프로필 또는 두 유형의 프로필이 반환되는지 여부를 지정하는 열거형 값 중 하나입니다.
반품
데이터 원본의 프로필 수입니다.
예제
다음 코드 예제에서는 구성된 applicationName 프로필의 모든 프로필에 대한 프로필 정보를 표시하고 프로필 수도 반환합니다.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Profile" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
public void Page_Load()
{
TotalLabel.Text = ProfileManager.GetNumberOfProfiles(ProfileAuthenticationOption.All).ToString();
GetProfiles();
}
private void GetProfiles()
{
ProfileGrid.DataSource = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All);
ProfileGrid.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Sample: Find Profiles</title>
</head>
<body>
<form id="form1" runat="server">
<h3>Profile List</h3>
<asp:Label id="TotalLabel" runat="server" text="0" /> Profiles found.<br />
<asp:GridView id="ProfileGrid" runat="server"
CellPadding="2" CellSpacing="1" Gridlines="Both">
<HeaderStyle BackColor="darkblue" ForeColor="white" />
</asp:GridView>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Web.Profile" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Public Sub Page_Load()
TotalLabel.Text = ProfileManager.GetNumberOfProfiles(ProfileAuthenticationOption.All).ToString()
GetProfiles()
End Sub
Private Sub GetProfiles()
ProfileGrid.DataSource = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.All)
ProfileGrid.DataBind()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Sample: Find Profiles</title>
</head>
<body>
<form id="form1" runat="server">
<h3>Profile List</h3>
<asp:Label id="TotalLabel" runat="server" text="0" /> Profiles found.<br />
<asp:GridView id="ProfileGrid" runat="server"
CellPadding="2" CellSpacing="1" Gridlines="Both">
<HeaderStyle BackColor="darkblue" ForeColor="white" />
</asp:GridView>
</form>
</body>
</html>
설명
이 GetNumberOfProfiles 메서드는 구성 파일의 특성에 의해 지정된 애플리케이션에 대한 데이터 원본에서 모든 사용자 프로필의 applicationName 수를 검색하는 데 사용됩니다. 매개 변수를 authenticationOption 사용하여 익명 프로필만, 인증된 프로필만 검색할지 또는 모든 프로필을 검색할지를 지정합니다.