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

?????? ????????? ?????? ?????????
???? ???????: 313091 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ??????? ????? ????? ?????? ?????????? ?? ?????? ?? ??? ?????? ??? ????? ???????? ?????? ??????? ?? ??????? ????????. ????? ??????? ?????? ???? ???? ???????? ?? ??? ??????? ?????? ??? validationKey ??????? decryptionKey ?????? <machinekey>??<system.web> ???? ?? Machine.config ? Web.config ?? ???????.

???????

???? ??????? ??????? ??????? ?????? ??? ????? ?????? ???????? ?????? ? ??? ??????? ???? ???????:
  • Microsoft Windows 2000 ?? Microsoft Windows XP
  • ???? ??? Microsoft .NET
  • ????? ??????? ???????? ?? Microsoft "(IIS)

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

  1. ??? ????? Microsoft Visual Studio .NET.
  2. ?? ??????? ??? ? ??? ??? ???? ?? ???? ??? ???????.
  3. ?? ????? ????? Project ???? ??? ?????? Visual Basic.
  4. ?? ????? ????? ???? ??? ????? ???? ??????.
  5. ?? ???? ???? ??? ???? HashConfigVb ??? ?? ???? ??? ?????.

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

???? ????????? ???????? ?? ??? ?????? ????????? ???? ?? ??????? ?? ??? ???????:
  • ??????? ?????? ?? ??? ????? ?????? ????????? ?? ????? ??? decryptionKey.
  • ??????? ??????? ?? ??? ????? ?????? ????????? ?? ????? ??? validationKey.
?????? ???????? ???????? ???? ????? ??????? ?????? ??? ?????? ?? ????? ?????? ???? ????? ??? ????? ??? ???????. ??? ????? ???? ?????? ??????? ????? ?????? ??? ????? ?????? ????? ?????? ????????? ?? ????? .config.

?????? ?? ????? ???? ???? ???? ??? ?????? ????? ??? ?????? ???? ??? ??????? ?? ??? ???????. ??? ???? ??????? ??? ???? 24 ???? ?????? ??? ????? ??????? ??????? 48 ???? ?? ??? ??? ????? ???????. ????? ??????? ?? decryptionKey ?? 8 ?? 24. ???? ??? ??? ????? ????? ?? 16 ???? ????? ???????? ??????? (DES) ?? 48 ???? ??????? ?? ????? Triple DES ??? ???????. ????? ??????? ?? validationKey ?? 20 ??? 64. ???? ??? ??? ????? ?????? ?? 40 ??? 128 ???? ?? ??? ??? ????? ???????. ???? ??????? ?? ????????? ???????? ??????? <machinekey> ?????? ???? ??? ? ??? ?? Machine.config ?? ??? Web.config.

  1. ????? ??? ??? ???? ???? KeyCreator ??? ??????? Visual Basic.
  2. Replace the existing code in the KeyCreator.vb file with the following code:
    Imports System
    Imports System.Text
    Imports System.Security.Cryptography
    
    Namespace Crypto
      Public Class KeyCreator
    	
        Public Shared Sub CreateMachineKey()
          Dim commandLineArgs As String()
          commandLineArgs = System.Environment.GetCommandLineArgs()
    
          Dim decryptionKey As String
          decryptionKey = CreateKey(System.Convert.ToInt32(commandLineArgs(1)))
          Dim validationKey As String
          validationKey = CreateKey(System.Convert.ToInt32(commandLineArgs(2)))
    
          Console.WriteLine("<machineKey validationKey=""{0}"" decryptionKey=""{1}"" validation=""SHA1""/>", _
          validationKey, decryptionKey)
         End Sub
    
         Public Shared Function CreateKey(numBytes As Integer) As String
           Dim rng As RNGCryptoServiceProvider = New RNGCryptoServiceProvider()
           Dim buff(numBytes -1) As Byte
    
           rng.GetBytes(buff)
    				
           Return BytesToHexString(buff)
         End Function
     
         Public Shared Function BytesToHexString(bytes As Byte()) As String
           Dim hexString As StringBuilder = New StringBuilder(64)
           Dim counter as Integer
    
           For counter = 0 To bytes.Length - 1
             hexString.Append(String.Format("{0:X2}", bytes(counter)))
           Next
    
           Return hexString.ToString()
        End Function
    
      End Class
    End Namespace
    					
  3. ?? ???? ????? Module1.vb ???? ??? ?????? ???? ??????? ?? ?? ?????? ???????? ???????? ??????? ?? ????? ???? ???????:
        Dim MyKeyCreator As New Crypto.KeyCreator()
        MyKeyCreator.CreateMachineKey()
    					
  4. ????? ???????.

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

????? ??????? ?? ???? ??????? ?? ?? ????? ?? ?????? ??? ???? ??? ??? ?? ??????? ??????? ?????? ?? ?????. ??? ??? ??????? ????? ???? ?????? HashConfigVb.exe ???? ???? ?????? ?????? ?? ???? ??????? ?? ??? ???? ???????:
HashConfigVb.exe 24 64
??? ?? ???? ??????? ?????? ????? ????? ??????? ??????:
<machineKey validationKey="08CE6B478DCE73..........E566D8AC5D1C045BA60"
            decryptionKey="4252D6B2268.........67F451CE65D0F2ABE9BCD3A"
            validation="SHA1"/>
					
?????? ???? ????????? ???????? ?????? ???? ????? ??????? ? ??????? ????? ?? ???.

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

  1. ??? ???? ?? Machine.config ?? Web.config ?? ?????.
  2. ??? ???? ?????? <system.web> ?? ??? ???????.
  3. ??????? ?????? <machinekey>??????? ?? ????? ???? ??????. ?? ???? ??? ???? ???? <machinekey>???????.
  4. ??? ??? ???????.
  5. ????? ????? IIS ??? ???? ??????? ?? ??????? ??? ??? ???? ????????? Machine.config.

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

???? ?? ?? ?????? <machinekey>?? ?????? ??????? ????? (??? ?? ?????????? AutoGenerate ?????? ?? ?????? <machinekey>) ??? ????? ??? ?? ???????????? ???????:
  • ??? ??????? ?????? ???????.
  • ??? ????? ???? ???? ????? ?? ??? StateServer.
  • ??? ???? ???? ????? ????? ??? ????? ??? ???? ????? ??? enableViewStateMAC ??? True ???? ???????.

?????

?????? ??? ??????? ??????? ???? ??? ????? ???????? ??????? ?????? ?? "????? ??????? ?? Microsoft:
308157????? ????? ?????? ?????? ??? ??????? ?? ??????? ASP.NET ???????? Visual Basic .NET
306238????? ????? ?????? ??????? ??? ????? ?? ???????? ???????? ??? ??????? ?? ??????? ASP.NET ???????? Visual Basic .NET
306590INFO: ???? ???? ??? ???? ASP.NET?
307626INFO: ???? ???? ??? ????? ASP.NET

???????

???? ???????: 313091 - ????? ??? ??????: 17/????/1428 - ??????: 3.10
????? ???
  • Microsoft ASP.NET 1.0
  • Microsoft Visual Basic .NET 2002 Standard Edition
  • Microsoft ASP.NET 1.1
  • Microsoft Visual Basic .NET 2003 Standard Edition
????? ??????: 
kbmt kbproductlink kbconfig kbhowtomaster kbsecurity kbstate KB313091 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????313091

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

 

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