????? ????? ?????? ?????? ??? ????? ???????? ???????? ???????? ??? ??????? ?? ????? ASP.NET ????? ?? ???????? Visual Basic.NET

?????? ????????? ?????? ?????????
???? ???????: 306238 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ????? ????? ?????? ??????? ??? ????? ?? ??????? ASP.NET ???? ???? ?????? ?????? ?????? ??? ??????? ???????? Visual Basic.NET.

???????

????? ??? ??????? ?? ????? ???? ???????? ???????? ??? ??????? ?? ????? ASP.NET.?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ? Microsoft":
308157 ????? ????? ?????? ?????? ??? ??????? ?? ????? ASP.NET ????? ?? ???????? Visual Basic.NET

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

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

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

??? ???????? ???????? ??????? ?? ????? Global.asax ?? ????? ????? ?????? ??????? ??????? ?????? ?? ????? ????? Application_AuthenticateRequest :
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal 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
        id = HttpContext.Current.User.Identity

        Dim MyRoles(2) As String
        MyRoles(0) = "Manager"
        MyRoles(1) = "Admin"
        HttpContext.Current.User = new System.Security.Principal.GenericPrincipal(id,MyRoles) 
    End if
End if
End sub
				

???? ?? ????? ???????? ?????? ???? ???????? ?? ????? ASPX

???? ??????? ??????? ????? ????? ??????? ???? ???????? ???????? ??? ??????? ???? ????? ????? ???????? ???????.
  1. ????? ????.aspx ????? ???? Sample.aspx ???? ????????? ???????? ???????:
    <%@ Page Language="VB" %>
    <%@ Import Namespace="System.Web" %>
    
      <script runat=server>
        Sub Page_Load(Src As Object, E As EventArgs)
    	if User.IsInRole("Admin") then
    		Response.Write ("You are an Administrator")
    	Else
    		Response.Write ("You do not have any role assigned")
    	End if
        End Sub
    
      </script>
    					
  2. ??? Sample.aspx ?? ????? ?????. ?????? ?????? ??? ?????? ????????.

?????

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

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

???????

???? ???????: 306238 - ????? ??? ??????: 08/?? ?????/1433 - ??????: 1.0
????? ???
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft Visual Basic .NET 2003 Standard Edition
  • Microsoft Visual Basic .NET 2002 Standard Edition
????? ??????: 
kbproductlink kbhowtomaster kbsecurity kbmt KB306238 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????306238

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

 

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