国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
vb.net教程 ArrayList類

ArrayList類與List(of T)的用法差不多,提供的方法也差不多。

Add():在結(jié)尾處添加數(shù)據(jù)
RemoveAt():移除指定位置的數(shù)據(jù)
Insert():在指定位置處插入數(shù)據(jù)
Clear():移除所有元素

屬性:

Count:返回包含的數(shù)據(jù)數(shù)量

與List(of T)不同的是,ArrayList可以包含任意類型的數(shù)據(jù),但是相應的,要使用包含的數(shù)據(jù),就必須對數(shù)據(jù)做轉(zhuǎn)換。

如下例代碼:

  1. Sub Main()
  2. Dim arrDate As New ArrayList
  3. Dim addString As String = "this is a test"
  4. Dim addInteger As Integer = 123
  5. Dim addDateTime As New DateTime(2017, 3, 20, 10, 10, 10)
  6. arrDate.Add(addString)
  7. arrDate.Add(addInteger)
  8. arrDate.Add(addDateTime)
  9. Console.WriteLine("包含數(shù)據(jù)數(shù)量:" & arrDate.Count)
  10. Dim toString As String = CType(arrDate(0), String)
  11. Dim toInteger As Integer = CType(arrDate(1), Integer)
  12. Dim toDateTime As DateTime = CType(arrDate(2), DateTime)
  13. Console.WriteLine("數(shù)據(jù)1:{0}", toString)
  14. Console.WriteLine("數(shù)據(jù)2:{0}", toInteger)
  15. Console.WriteLine("數(shù)據(jù)3:{0}", toDateTime)
  16. Console.ReadKey()
  17. End Sub

運行結(jié)果如下:

 

 

由于.net平臺下C#和vb.NET很相似,本文也可以為C#愛好者提供參考。

學習更多vb.net知識,請參看 vb.net 教程 目錄

本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VB.NET 日期使用
用新VB.NET 枚舉提高效率(VB.NET enumeration efficiency...
ASP.NET夜話之二十一asp.net網(wǎng)站的性能優(yōu)化 - worm128的日志 - 網(wǎng)易...
VB.NET教程
ASP.NET2.0 綁定數(shù)據(jù)字段字符串格式
C#和VB.net語法對比圖
更多類似文章 >>
生活服務
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服