<%@ Page Language="VB" %>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim myStack As New Stack(Of Integer)
myStack.Push(5)
myStack.Push(3)
myStack.Push(10)
Dim myArray As Array
myArray = myStack.ToArray()
Dim x As Integer = 0
For Each item As Integer In myArray
x += item
Next
Label1.Text = x.ToString()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label runat="server" ID="Label1"></asp:Label>
</div>
</form>
</body>
</html>
|