default.aspx
来自「This is a book about vb.you could learn 」· ASPX 代码 · 共 78 行
ASPX
78 行
<%@Page Language="VB"%>
<%@ Import Namespace="System.IO" %>
<%
dim authors as string()
redim authors(5)
authors(0) = "Richard"
authors(1) = "Alex"
authors(2) = "Dave"
authors(3) = "Karli"
authors(4) = "Brian"
dim e as IEnumerator
e = authors.GetEnumerator()
dim author as string
do While e.MoveNext() = true
Response.Write("<P>" + e.Current )
author = CType( e.Current, string )
Loop
for each author in authors
Response.Write("<P>" + author)
next
'VB
if Array.IndexOf(authors, "Richard") <> -1 then
Response.Write("<P>Richard is in the author list")
end if
'VB
dim index as integer
index = Array.IndexOf(authors,"Richard")
if index <> -1 then
Response.Write("<P>" & authors(index) & " is in the author list")
end if
'VB
dim list as IList
list = CType(authors, IList)
if list.Contains("Richard") then
index = list.IndexOf( "Richard")
Response.Write("<P>" & list(index) & " is in the author list")
end if
dim movieList as IList
movieList = new ArrayList()
movieList.Add("Pulp Fiction")
movieList.Add("Aliens")
'VB
dim variedItems as ArrayList = new ArrayList()
variedItems.Add("Pulp Fiction") ' add a string
variedItems.Add(1234) ' add an integer
variedItems.Add(new ArrayList()) ' add another array list
%>
</form>
<p style="color:red" id=status EnableViewState=False runat=server />
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?