???????: ???? ???? ??? ???? ASP.NET

?????? ????????? ?????? ?????????
???? ???????: 306590 - ??? ???????? ???? ????? ????? ??? ???????.
???? ??? ??????? ???.net Microsoft ??????? ????? ?????? ???? ?????? ???????:
  • System.Web.Security
  • System.Web.Principal
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ????? ??? ASP.NET ????.

?????? ??? ????? ???? ASP.NET ??????? ???? ?? ??? ????? ????? ????? Microsoft:
305140 ???????: ????? ?????? ASP.NET

??????? ????

????? ASP.NET ?????? ?? ?????? ?????? ?????? ? ??????? ????? ??. ???? ?????? ASP.NET ???????? ?? "????? ??????? ??????" ?????? (IIS) ?????? ????? ???????? ???????? ? ????? ????? ?????? ASP.NET. ????? ASP.NET ???? ???? ????? ???? ?????? ???? ???? ??????? ??? ?? Microsoft Windows ? ?????? ?????????? ??? Windows.

??? ????? ??? ??????? ??? ?? ??? ???????:

???? ?????? ?? ???

??????? ??????? ??????? ?????? ??????? ??? ?????? ???? ???:
  1. ???? ???? ????.aspx ?????? ??? IIS ????.
  2. ??? ????? ?????? ???????? ?????? ??????? ??? IIS.
  3. ??? ?????? ?????? IIS ?????? ???????? ????? ?????? ???? ??? ??? ?? ??? ?????? ??????? ??????? ASP.NET.
  4. ???????? ??? ????? ?????? ??????? ????? ?? IIS ? ???? ASP.NET ??????? ??????? ?????? ???? ?? ??? ??? ???? ?????? ??? ?????? ??? ???? ??????? ???? ???? ??????? ?????. ?? ????? ????? ??? Microsoft ????? ?????? ?????? (ASP) ? ASP.NET? ASP.NET ?? ??? ????? ?????? ???????? ???? ???????. ?????? ????????? ??? ????? ????? ?????? ?? ???? ?????? ?? ??? Web.config ??? true.
????? ?? ????????? ??? ???? ??????? ???? ??? ??????? ?????? ??.net ???? ?????? ????? Kit (SDK) ???????:
???? ???????? ASP.NET
.aspx http://msdn.microsoft.com/en-us/library/xa68twcb (vs.71)
????? ?? ????????? ??? ?????? ?? ASP.NET? ???? ??? ??? ??????? ?????? ?????? ?? ????? ????? Microsoft:
306158 ???????: ????? ???????? ?? ??? ??????? ASP.NET

??????? ??????? ??? ?????

????? IIS ??????? ??????? ???????? ??????? ?? IIS ????? ???????. ??? ???? ????? ASP.NET ?????? (??????) ??????? ??????? ?? ????? ??????? ??? ??????? ??????? (XML). ??? ????? ?? ??? ????? ??? ????? ????? ??? ??????? ????? ?? ?? ?????? ????? ???? ?????? ???? ????? ??????? ????? ??? ??????? ?????? ??? ?? ????? ????? IIS ? ASP.NET ??????? ?? ???? ??? ??????? ????? ?? (Web.config).

?? ??? ????? ??????? ???????? ??????? ASP.NET:

????????

???????? ?? ??????? ?? ?????? ?????? ??? ????? ?????? ???????? ??? ??? ???????? ????? ?????? ??????? ?? ??? ?????? ???????? ??? ?? ??? ??????.

???? ASP.NET ???????? ????? ?????:

?????? ???????

???? ??? ???? ?????? ??????? ?? ???? ??? ????? ????? ????? ??????? ??? ????? ??? ????? ???? ????? (HTML) ???? ?????????? ?????? ?????? ???????? ?????? ???. ??? ????? ?????? ?????? ???????? ????? ???????? ??? ?????? ??????? ????? ??????? ?????? ????? ????? ?? ????? ??? ????? ????????. ????? ??? ????? ???????? ??? ?????? ???????? ?? ????? ?????? ????? ??????. ??????? ??????? ?? ????? ???????? ???????? ??? ????? ????????.

????? ?? ????????? ??? ?????? ???????? ???? ??????? ?????? ??.net Framework SDK ???????:
???? ?????? ???????
.aspx http://msdn.microsoft.com/en-us/library/907hb5w9 (vs.71)
?? ??? ?????? ??????? ??? ??????? ?????? ?? ASP.NET? ???? ??? ?????? ??? ????? ???? ??????? ?? ????? ????? Microsoft:
301240 ?????: ????? ??????? ???? ????? ?????? ?? ????? ASP.NET ????? ?? ???????? C#.net

?????? Windows

?? ?????? Windows? ???? IIS ????????? ? ??? ????? ????? ????? ????? ?????? ??????? ??????? ASP.NET. ??????? ???? ???? ?? ??????? Windows ???????? ??? ????? ??????? ???? ??????. ?? ????? ??? ??????? Windows ?????? ????? ???? ?????? Windows ???? ????? ??? IIS ??? ?? ????? ????? ??? ASP.NET.

????? ?? ????????? ??? ?????? Windows? ???? ??????? ?????? ??.net ???? ????? SDK:
???? ??????????????????????????
.aspx http://msdn.microsoft.com/en-us/library/907hb5w9 (vs.71)

?????? passport

?????? passport ???? ?????? ??????? ???? ?????? Microsoft? ???? ???? ???????? ???? ???? ??? ??????? ??????? ??????? ???????. ????????? ??? ??????? ?????? Passport ??? ?????? ??? ???? ??? ???? ??? ?????? ??????.

????? ?? ????????? ??????? ??? ?????? Passport? ???? ??????? ?????? ?? ?????.net framework SDK:
???? ?????? Passport
.aspx http://msdn.microsoft.com/en-us/library/f8e50t0f (vs.71)

???????? ??????????

??? ??????? ???????? ?????????? ????? ?? ???? ?? ?????? ??? ????? ??? ????? ??? ????? ?????? ??????? ?????? ??? ????. ???? ??? ???? ????? ???????? ???????? ?????????? ???? ?????? ?????? ??????? ????? ??. ????? ???? ?????? ??? ???? ??????? ??? ??????? ?????? ??????? ?????? ??????? ?????? ??.

???????

??????? ?? ????? ?????? ?? ???? ???????? ?????? ???? ?? ?????? ??? ??????? ????????.

???? ASP.NET ????? ??????? ???????:

?????????????

???? ????? ????? ??? ????????????????????? ????? ???? ??? ??????? ?????? Windows. ????????????????????? ???????? ?? ????? ????? ??? ?????? ??????? ??? Windows ????? (ACLs) ?????? ?? ??? ??? ??? ?? ???? ??????? ??????.

??????????????

????? ?????????????????????? ???? ????? ???? ???? ????????? (URL) ???? ????? ??????? ???????? ??? ????? ??? URI. ???? ?? ???? URI ?????? ??????? ?????? ????? ?? ?????? ???????? ???????? ???? ?? ?????? NTFS ??????.

???? ?????????????????????? ?????? ??? ??????? ??????? ??????? ????????? ?????? ???? ??????? ?????? ??????? ?????? ???? ??????? ?? ??? ?????? ??? ????? ??????? ?? ????? ??? URI ??????????? ??????? (??? "?????"? ??????? ??????????)? ???????? (??? GET ? POST).

?? ??? ???? ?? ????????? ??? ????? ?? ASP.NET? ???? ??????? ?????? ?? ?????.net Framework SDK:
????? ASP.NET
.aspx http://msdn.microsoft.com/en-us/library/wce3kxhd (vs.71)

?????? ??????? ??? ?????

?????? ?????? ??? ????? ?? ASP.NET ????? ?????? ??? ????? ?????? ???? ?????? Microsoft COM + ? Microsoft ?????? Server (MTS)? ??? ????? ?? ?? ???? ???????? ????. ?????? ?????? ??? ????? ?? ASP.NET ????? ??? ?????? Windows ????????. ??? ???? ??????? ??? ???? ?????? Windows ???? ????? ????????? ????? ???????? ???? Windows (User.Identity.Name = "??????\??? ????????"). ????? ?????? ?? ??????? ?????? ????? ??????? ?? ????? ????? ????? ?????? ???? ????. ?? ??? ??? ???? ??????:

????????? ???????? Visual Basic.net
If User.IsInRole("BUILTIN\Administrators") Then
   Response.Write("You are an Admin")
Else If User.IsInRole("BUILTIN\Users") then
   Response.Write("You are a User")
Else
   Response.Write("Invalid user")
End if
				
??? visual C#.net
if ( User.IsInRole("BUILTIN\\Administrators"))
   Response.Write("You are an Admin");
else if (User.IsInRole("BUILTIN\\Users"))
   Response.Write("You are a User");
else
   Response.Write("Invalid user");
				
??? ??? ?????? ?????? ???????? ?? ??? ????? ??????? ?????? ??? ???????? ??? ?????? ???? ???????. ?????? ??????? ?????? ????????? ?????? ????? ????????????? ?????? ??????? ???????? (??? ??????? ?????? ??????? ???????? ?? ??? ??????) ?????? ???? GenericPrincipal ???? ?????? ??? ????? ???????? httpcontext ???? ??????. ???? ???????? ???????? ??????? ????:

????????? ???????? Visual Basic.net
Public Sub Application_AuthenticateRequest(s As Object, e As EventArgs)
   If (Not(HttpContext.Current.User Is Nothing)) Then
      If HttpContext.Current.User.Identity.AuthenticationType = "Forms" Then
         Dim id as System.Web.Security.FormsIdentity = HttpContext.Current.User.Identity
         Dim myRoles(3) As String
         myRoles(0)= "managers"
         myRoles(1)= "testers"
         myRoles(2)= "developers"
         HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,myRoles) 
      End If
   End If
End Sub
				
??? visual C#.net
public void Application_AuthenticateRequest(Object s, EventArgs e)      
{
   if (HttpContext.Current.User != null)
   {
      if (HttpContext.Current.User.Identity.AuthenticationType == "Forms" ) 
      {
         System.Web.Security.FormsIdentity id = HttpContext.Current.User.Identity;
         String[] myRoles = new String[3];
         myRoles[0]= "managers";
         myRoles[1]= "testers";
         myRoles[2]= "developers";
         HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,myRoles);
      }
   }
} 
				
?????? ?? ??? ??? ???????? ?? ??? ???? ????? ?????? ????? ????? ?????? ????????? ???????? ??????? (?? ??????) ?? ?????.aspx:

????????? ???????? Visual Basic.net
If User.IsInRole("managers") Then
   Response.Write("You are a Manager")
Else If  User.IsInRole("testers") Then
   Response.Write("You are a Tester")
Else If User.IsInRole("developers") Then
   Response.Write("You are a Developer")
End if
				
??? visual C#.net
if (User.IsInRole("managers"))
   Response.Write("You are a Manager");
else if (User.IsInRole("testers"))
   Response.Write("You are a Tester");
else if (User.IsInRole("developers"))
   Response.Write("You are a Developer");
				
?????? ??? ??????? ??????? ???? ??? ??????? ??? ????? ???? ??????? ?? ????? ????? Microsoft:
306238 ?????: ????? ????? ??? ??? ?????? ???????? ???????? ???????? ??? ??????? ?? ????? ASP.NET ????? ?? ???????? Visual Basic.net
????? ?? ????????? ??? ?????? ??????? ??? ?????? ???? ??? ??????? ?????? ?? ?????.net Framework SDK:
?????? ??????? ??? ?????
.aspx http://msdn.microsoft.com/en-us/library/52kd59t0 (vs.71)

?????

????? ?? ????????? ??? ??????? ?????? ASP.NET? ???? ??????? ?????? MSDN ??????:
???????? ?? ASP.NET: ??????? ??????.net
http://msdn.microsoft.com/en-us/library/ms978378.aspx
????? ?? ????????? ?????? ??? ASP.NET? ???? ??? ????? MSDN ??????:
microsoft.public.dotnet.framework.aspnet
?????? ??? ??????? ??????? ???? ??? ??????? ??????? ????? ???? ???????? ?? Microsoft Knowledge Base:
311094 ???: ????? ????? "?????????????????????" ??? ????? ?????? ????? ???????
306359 PRB: Request.ServerVariables("LOGON_USER") ????? ????? ????? ?? ASP.NET
313091 ?????: ????? ?????? ???????? Visual Basic.net ????????? ?? ?????? ???????
313116 PRB: ????? ????? ???????? ??? ????? ??? loginUrl ????
????? ?? ?????????? ???? ????? ???????:
?????? ?????? ?. ????? ??????? Microsoft ASP.NET. Microsoft Press? 2001.

????????? ????.???? ???? ??? ?? ADO.NET ? ASP.NET. Microsoft Press? 2001.

???????

???? ???????: 306590 - ????? ??? ??????: 08/?????/1433 - ??????: 1.0
????? ???
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 1.1
????? ??????: 
kbproductlink kbarttyperoadmap kbconfig kbinfo kbsecurity kbweb kbmt KB306590 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????306590

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com