default.aspx

来自「Code for VB.NET教程源码 很好的源码」· ASPX 代码 · 共 59 行

ASPX
59
字号
<%@Page Language="VB" %>

<%

Dim alphabet As New SortedList()

alphabet = CollectionsUtil.CreateCaseInsensitiveSortedList()

alphabet.Add( "Z", "The Letter Z" )
alphabet.Add( "A", "The Letter A" )
alphabet.Add( "S", "The Letter S" )

Response.Write("<h3>A sorted list</h3>")

Dim letter As DictionaryEntry
For Each letter in alphabet
	Response.Write( "<BR>" & letter.Key & " - " & letter.Value)
Next

Response.End()

Dim names As New Hashtable()

names.Add( "RA", "Richard Anderson" )
names.Add( "DS", "David Sussman" )
names.Add( "RH", "Rob Howard" )
names.Add( "AH", "Alex Homer" )
names.Add( "KW", "Karli Watson" )
names.Add( "BF", "Brian Francis" )


Response.Write("<h3>Unsorted list</h3>")

Dim name As DictionaryEntry
For Each name in names 
	Response.Write( "<BR>" & name.Key & " - " & name.Value)
Next


Response.Write("<h3>Sorted list</h3>")

' Create a sorted copy of the list 

Dim sortedNameList As New SortedList( names )

For Each name in sortedNameList
	Response.Write( "<BR>" & name.Key & " - " & name.Value)
Next

' Create a sorted copy of the list 

'Dim name As String
'For Each name in sortedNameList.GetValueList()
'	Response.Write( "<BR>" & name )
'Next


%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?