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

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

?? ????? ??

??????

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

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

???? ???????

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

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

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

?? ?? ?????? ?????? ?? ??????? ????? ??? ????????? ?????? ???? ??:
  1. ?? IIS ???? ?? .aspx ????? ?? ?????? ?????? ??????
  2. ??????? ????????????? IIS ??? ???? ???
  3. IIS authenticates ?????? ?? ???????? ???????? ???? ?? ???? ASP.NET ????? ????????? ??????? ?? ?????? ?? ????
  4. IIS ?? ?????????? ???? ?????? ?? ??? ????????? ?? ??? ???????????? ????????, ASP.NET ????? ?? ???? ?? ??? ?????? ??????? ????? ?? ??? ?????????? ?? ?????????? ???? ???? ????? ??? ASP.NET, ASP.NET ?? Microsoft ?????? ????? ????? (ASP) ?? ??? ???? ???? ?? ?????????? ?????????? ???????? ??? ?? impersonates. ????????? ????? ???? ?? ??? ?????? ??? web. config ????? ??? ?? ?? ????? ?????? ?????????? ??????? ??? ???? ?????
??????? ?????? ?? ???? ??? ???? ??????? ?? ???, ????? ?????????? ???? ??? .net Framework ?????????? ????? ??? (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) ???????????? ????? ??? ????????? ?????? ?? ????????? ????????? ????????? ?? ??????? ?? simplifies ???? ????????? adopts ??????? ???? standpoint, necessitates IIS ??????? ?? ASP.NET ????????? ?? ??? ???????????? (web. config) ?? ?????? ?? ???????????? ????? ???

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

???????

?????????? ????????? ????? ?????? ????? ???? ?? ??????? ??. ?????????? ?? ??? ?? ??????? ???? credentials ?? ?? ????????????? ????? ??? ?????????? ?? ????????

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

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

??????? ??????? ?????? ?? ???????? ???? ?? ?????? ????????? ??? ?????? ??????? ?????? ???????????? ??????? ???????? (HTML) ??? ?????????????? ??? ???????????? ?? ???? ??????????? ???? ????? ???? ??? ?????????? ????????????? ?????? ???? ?? ?? ???? ?????? ?? ?????? ???????? ??????? ????????? authenticates ?? ?? ???? ?? ??? ??? ????????? ????? ?? ???? ??? ????????????? ?? ??? ????? ??????? ?? ????? ????? ???????? ?????? ???????? ???? ?? ????? ?????

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

Windows ??????????

Windows ?????????? ??? IIS ?????????? ???? ??, ?? ???????? ???? ASP.NET ????? ????????? ?? ???????? ???? ??? Windows ?? ????? ?? ?? ??? ?????????? ?? ???????? ?? ?? ?? ?????? ?? ???????? ??? ?? Windows ?? ????? ?? ???? ??? IIS authenticates Windows ?????????? ???? ?? ???????? ???? ??? ??????? ??? ?? ??? ?? ???? ASP.NET ?? ??? ?????? ????

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

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

???????? ??????? centralized ?????????? ???? ??, ??? ?? Microsoft ???? ??, ?? ?? ??? ??? ?? ?????????? ?? ??? ???? ????????? ????? ???? ?? ???? ???? ?? ?? ???????? ??, ?? ??????????, ???????? ?????????? ?? ????? ???? ?? ?????? ?????? ????? ?????? ?? ??? ????

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

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

?? ???? ???? ?? ??????? ????? ???, ?? ???????? ?????????? ?? ????? ???? ?? ???? ??? ????????? ??; ???? ????? ??????? ?? ??? ?????? ?? ???????? ??? ?????????? ????????? ?? ??? ???????? ??????? ?????? ???? ?? ???? ????????? ?? ??? ?????? ????????? ?? ??????? ??????? ?? ?? ?? ?? ???? ????? ??????? ??????? ?? ????? ???? ?? ????? ?????

?????????

????????? ??, ?? ???????? ????????? ???????? ?????????? ?? ?????? ??? ?? ???????? ?? ????? ???

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

FileAuthorization

FileAuthorizationModule ???? ????????? ????? ????????? ???? ?? ?? ?? ?? ?? ????? ???? ??? ?????? ?? Windows ??????????? FileAuthorizationModule ????? ???????? ?? ???? ???? ?? ??? ????????? ?? ????????? ???? ?? ???? ?????????? ?????? ???? ????? ???? ?? ??? (Acl) ???????? ???? ???

UrlAuthorization

UrlAuthorizationModule ???? ?????????? ??????? ?????? (URL) ????????? ???? ??, ?? ???? ?? URI ???????? ????????? ????????? ???? ??? ???????? URI ?? ???? ??? ??? ?????? ????? ????? ????? ?? ??????? ?? ?? NTFS ????????? ?? ?????? ?????

UrlAuthorizationModule ????? ????????? ?? ????????? ????????? assertions ???? ????; ????, ???? ??????? ??? ?? ??? ?? ??? ???? ?? ??? ?????? ???? ?? ??? ????? ?? ???? ??? ?????????? ????? (????, ??????? ?? ??? URI ???????? ?? ???? ????? testers, ?? ??????????), ?? ???????? (???? ??????? ?? ?????)?

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

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

?????? ?????? ??????? ASP.NET ??? ???-?????? ?? ??? ???? ?? ??????? ????? ????? Microsoft COM + ?? Microsoft ????????? ????? (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");
				
??????? ??????? ?? ????? ?? ??? ???, ?? ????? ?? ?????? ?? ???? ?????????? ??????????; ??? ?? ????????? ?? ???? ??? ???? ?????? ????? ?? ????? ???? ?? ??? ?????????? ??????????, OnAuthenticate ???? (?? ?? ??????? ??????? ??????? ?? ????? ???? ?? ?????? ??? ?????????? ???????) HttpContext ?? ?????????? ??? ?? ??? ????? ???? ?? ?? GenericPrincipal ???????? ?? ????? ?? ???? ????? ??? ?????? ??. ??:

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 ???? ????: ??????????? ???-?????? ????????? ?????? ?????????? ?? ????? ?? Visual Basic .net ASP.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 ???????? ??? ???? ????? ?? ??? ???????? ??:
311094 ??: "ConfigurationException" ?????? ????? ?? Impersonated ???? ????? ?? ??? ????????????
306359 PRB: Request.ServerVariables("LOGON_USER") ???? ?? ????? ???????? ASP.NET ???
313091 ???? ????: ??????? ????????? ??? ????? ?? ??? Visual Basic .net ????? ?? ????? ?????
313116 PRB: ??????? ??????? ?????? loginUrl ????? ?? ??? ????????? ???? ???
???? ??????? ?? ???, ????? ???????? ?????:
Reilly, Douglas J. Designing Microsoft ASP.NET ?????????. Microsoft ?????, 2001?

Esposito, Dino.ADO.NET ?? ASP.NET ?? ??? ??? ?????? ???. Microsoft ?????, 2001?

???

???? ID: 306590 - ????? ???????: 28 ??? 2012 - ??????: 3.0
???? ???? ???? ??:
  • Microsoft ASP.NET 1.0
  • Microsoft ASP.NET 1.1
??????: 
kbproductlink kbarttyperoadmap kbconfig kbinfo kbsecurity kbweb kbmt KB306590 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??: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