PROGRAM TO DISPLAY THE CONTENTS OF AN ARRAY

DEFAULT.ASPX FILE:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        &nbsp;<asp:Label ID="Label2" runat="server" Text="DISPLAY THE CONTENTS OF AN ARRAY"
            Width="322px"></asp:Label><br />
        <br />
        <br />
        &nbsp;
        <br />
        &nbsp;<br />
        <br />
        <asp:Button ID="Button1" runat="server" Text="CLICK FOR ARRAY ACCESS" Width="279px" />
        <br />
       
        <br />
        <asp:Label ID="Label1" runat="server" Text="Given elements are displayed in the message Box"
            Width="336px"></asp:Label><br />
        <br />
        <br />
        <br />
   
    </div>
    </form>
</body>
</html>

DEFAULT.ASPX.VB FILE:

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim i As Integer
        Dim words() As String = {"one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"}
        For i = words.GetLowerBound(0) To words.GetUpperBound(0)
            MsgBox(words(i))
        Next
    End Sub
End Class


No comments:

Post a Comment