??? ????? ??????? ????????(SSP) ????? ????????

?????? ????????? ?????? ?????????
???? ???????: 246067 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

??????

???? "??????? ???????" ?? ??????? ?????? ???????? PERL ? ??? ??? ????? ????????? ?? ???? ????? ?? ?????? ????? ?????? ??????. ????? ???? ?????? ???? ????? ??? ????????? ???? ?? ??? ????? ??????? ?????? ??????? ???????? ???? ?? ??????. ????? ?? ??? ??????? ?? ????? ?????? SortDictionary() ??? ??????? ?????? ??????? ????? ?? ?????? ????? ??????? ?? ??????.

??????? ????

???? ?????? ?????? ?? ????????? ???????? ????? ????? dictKey ? dictItem ??? ???????? ?? ??? ?????? SortDictionary(). ???? ?????? SortDictionary() ??????? ?? ?????? ???? ?? ??????? ?????? ????? ??????? ???? "?" ??? ??????? ?????? ?? ??? ??? ???? ??? ??? ?????? ?? ????? ?? ???????.

Const dictKey  = 1
Const dictItem = 2

Function SortDictionary(objDict,intSort)
  ' declare our variables
  Dim strDict()
  Dim objKey
  Dim strKey,strItem
  Dim X,Y,Z

  ' get the dictionary count
  Z = objDict.Count

  ' we need more than one item to warrant sorting
  If Z > 1 Then
    ' create an array to store dictionary information
    ReDim strDict(Z,2)
    X = 0
    ' populate the string array
    For Each objKey In objDict
        strDict(X,dictKey)  = CStr(objKey)
        strDict(X,dictItem) = CStr(objDict(objKey))
        X = X + 1
    Next

    ' perform a a shell sort of the string array
    For X = 0 to (Z - 2)
      For Y = X to (Z - 1)
        If StrComp(strDict(X,intSort),strDict(Y,intSort),vbTextCompare) > 0 Then
            strKey  = strDict(X,dictKey)
            strItem = strDict(X,dictItem)
            strDict(X,dictKey)  = strDict(Y,dictKey)
            strDict(X,dictItem) = strDict(Y,dictItem)
            strDict(Y,dictKey)  = strKey
            strDict(Y,dictItem) = strItem
        End If
      Next
    Next

    ' erase the contents of the dictionary object
    objDict.RemoveAll

    ' repopulate the dictionary with the sorted information
    For X = 0 to (Z - 1)
      objDict.Add strDict(X,dictKey), strDict(X,dictItem)
    Next

  End If

End Function
				

A ????? ????

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

??????: ??? ????? ???? ????????? ?? ???? ????? ?????? ?? ??? ??????.

?? ???? ???????? ???????? ?? ASP ??????? ?? ??????? ????? ??? ???? ??? Sortdemo.asp ?? ????? ?????? ??????:
<%@LANGUAGE="VBSCRIPT"%>
<% Option Explicit %>
<html>
<head><title>Dictionary Sorting</title></head>
<body>
<%

  Dim d, i

  Const dictKey  = 1
  Const dictItem = 2

  Set d = Server.CreateObject("Scripting.Dictionary")

  d.Add "3", "Delta"
  d.Add "1", "Foxtrot"
  d.Add "4", "Bravo"
  d.Add "2", "Echo"
  d.Add "6", "Alpha"
  d.Add "5", "Charlie"

  Response.Write "<p>Before Sorting:<br>"
  For Each i In d
    Response.Write i & "=" & d(i) & "<br>"
  Next

  Response.Write "<p>By Key:<br>"
  SortDictionary d,dictKey
  For Each i In d
    Response.Write i & "=" & d(i) & "<br>"
  Next

  Response.Write "<p>By Item:<br>"
  SortDictionary d,dictItem
  For Each i In d
    Response.Write d(i) & "=" & i & "<br>"
  Next
%>
</body>
</html>
<%
  Function SortDictionary(objDict,intSort)
    Dim strDict()
    Dim objKey
    Dim strKey,strItem
    Dim X,Y,Z
    Z = objDict.Count
    If Z > 1 Then
      ReDim strDict(Z,2)
      X = 0
      For Each objKey In objDict
          strDict(X,dictKey)  = CStr(objKey)
          strDict(X,dictItem) = CStr(objDict(objKey))
          X = X + 1
      Next
      For X = 0 to (Z - 2)
        For Y = X to (Z - 1)
          If StrComp(strDict(X,intSort),strDict(Y,intSort),vbTextCompare) > 0 Then
              strKey  = strDict(X,dictKey)
              strItem = strDict(X,dictItem)
              strDict(X,dictKey)  = strDict(Y,dictKey)
              strDict(X,dictItem) = strDict(Y,dictItem)
              strDict(Y,dictKey)  = strKey
              strDict(Y,dictItem) = strItem
          End If
        Next
      Next
      objDict.RemoveAll
      For X = 0 to (Z - 1)
        objDict.Add strDict(X,dictKey), strDict(X,dictItem)
      Next
    End If
  End Function
%>
				
??? ???????, ??? ?? ??? ??? ??????? ??????:
Before Sorting:
3=Delta
1=Foxtrot
4=Bravo
2=Echo
6=Alpha
5=Charlie

By Key:
1=Foxtrot
2=Echo
3=Delta
4=Bravo
5=Charlie
6=Alpha

By Item:
Alpha=6
Bravo=4
Charlie=5
Delta=3
Echo=2
Foxtrot=1
				

???? Microsoft ??????? ???????? ??? ??? ?? ???? ??????? ?? ?? ?????. ??? ????? ???? ?? ????? ??? ???????? ??????? ?????? ???????? ?? ???????? ???? ????. ????? ??? ??????? ???? ?????? ?? ??? ??????? ???? ??? ????? ?? ??????? ???? ??? ????????? ?????? ?????? ?????????. ???? ??????? ????? ??? Microsoft ??? ????? ????? ???? ???? ?? ?????? ?????? ??? ??????? ?????? ????? ?????? ?? ????? ??????? ?????? ??????? ?????.
https://partner.microsoft.com/global/30000104
?????? ??? ???? ?? ????????? ??? ?????? ????? ???????? ???? ????? ??????? ????? Microsoft ?? ?????? ???? Microsoft ?????? ??? ?????:
http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

?????

?????? ??? ???? ?? ????????? ??? ?????? ??????? ?????? ?? Microsoft "? ???? ???? Microsoft ??? ??? ?????? ?????? ??? URL ??????:
http://msdn2.microsoft.com/en-us/library/ms950396.aspx

???????

???? ???????: 246067 - ????? ??? ??????: 25/???/1428 - ??????: 3.3
????? ???
  • Microsoft Internet Information Services 5.0
????? ??????: 
kbmt kbinfo KB246067 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????246067
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

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

 

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