????? ????? ?????? ??????? ??? ??? ?? ???????? ???????? ??? ??????? ?? ????? ASP.NET ????? ?? ?? ???? ??????? Visual C# .NET

?????? ????????? ?????? ?????????
???? ???????: 311495 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ????? ????? ?????? ??????? ??? ????? ?? ??? ??????? ASP.NET ???? ???? ?????? ???????? ???????? ??? ??????? ???????? Visual C# .NET


???????

????? ??? ??????? ?? ???? ?????? ???? ???????? ???????? ??? ??????? ??? ??? ??????? ASP.NET.
301240????? ????? ???????? ???????? ??? ??????? ?? ????? ASP.NET ????? ?? ???????? C# .NET

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

??? ??????? ?????? ????? ??? ??????? Microsoft Windows ? ??? ????? ??? ????? ?????? ??? ???? ???????. ????? ??? ????? ????? ???????? ??????? ??? ???? ???????? ???? ???? ????? ?????? ??????? ??? ????? ???? ????????? ???????? ?????? ??.

??????? ????? ???????? ???????? ?? ??? ?????? ?????? ?????? ??????? ??? ????? ?? ??????? ????? ??. ????? ??? ????? ???????? ???????? pre-specified ????? ???????? ????????. ???????? ??? ????? ????? ?????? ???????? "? ???? ????? ??????? ?????? ?? ??? ??????? ??????? ????? ????? ??? ??????? ???? ???????? ??????? ????? ?? ????? ???????? ???????? ???????.

??? ????????? ???????? ??????? ?? ??? Global.asax ?? ??????? ??????? ?????? ??????? ???????? ???????? ?? ????? ??????? Application_AuthenticateRequest:
public void Application_AuthenticateRequest( Object src , EventArgs e )
{
   if (!(HttpContext.Current.User == null))
   {
      if (HttpContext.Current.User.Identity.AuthenticationType == "Forms" )
      {
      System.Web.Security.FormsIdentity id;
      id = (System.Web.Security.FormsIdentity)HttpContext.Current.User.Identity;
      String[] myRoles = new String[2];
      myRoles[0] = "Manager";
      myRoles[1] = "Admin";
      HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,myRoles);
      }
   }
}
				

???? ?? ????? ???????? ?? ???? ?????? ?????? ?? ????????? ????? .ASPX

???? ??????? ??????? ????? ????? ??????? ???? ???????? ????? ??? ??????? ???? ????? ????? ???????? ????????.
  1. ????? ???? ????? .aspx ?????? Sample.aspx ?? ?? ???? ???????? ???????? ???????:
    <%@ Page Language="C#" %>
    <%@ Import Namespace="System.Web" %>
    
      <script runat=server>
        public void Page_Load() {
    	if (User.IsInRole("Admin")){
    		Response.Write ("You are an Administrator");}
    	else {
    		Response.Write ("You do not have any role assigned");}
        }
    
      </script>
    					
  2. ??? Sample.aspx ?? ??????? ???????. ?????? ?????? ??? ?????? ????????.

?????

?????? ??? ??????? ?????? ??? ????? ???? ASP.NET ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
306590INFO: ???? ???? ??? ???? ASP.NET?
????? ?? ????????? ??? ?????? ??????? ??? ????? ???? ??? ??????? .NET Framework ????? ?????? ??????? (SDK) ???????:
????? ??? ??? ??????
http://msdn2.microsoft.com/en-us/library/52kd59t0(vs.71).aspx
????? ???? ?????? ?? ???? MSDN ?????? ??? ??????? ??? ?????? ??????? ??? ????? ?????:
???? IBuySpy ??????
http://msdn2.microsoft.com/en-us/library/ms978480.aspx
???? Microsoft ??????? ??? ??????? ?????? ????? ???? ???????? ?? ?????? ??? ????? ??????. ?? ??? ????? ??????? ??? ??????? ??? ???? ?????. ??? ???? Microsoft ??? ??? ????????? ???? ???????.

???????

???? ???????: 311495 - ????? ??? ??????: 02/???? ??????/1428 - ??????: 3.9
????? ???
  • Microsoft ASP.NET 1.0
  • Microsoft Visual C# .NET 2002 Standard Edition
  • Microsoft ASP.NET 1.1
  • Microsoft Visual C# .NET 2003 Standard Edition
????? ??????: 
kbmt kbhowtomaster kbsecurity KB311495 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????311495

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

 

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