新聞中心
#T#VB.NET有很多值得學(xué)習(xí)的地方,這里我們主要介紹VB.NET對(duì)象列表。***步是要?jiǎng)?chuàng)建一個(gè)同用列表,你可以從多種途徑獲取數(shù)據(jù),但是最簡(jiǎn)單的方法是添加。文本中,我們會(huì)編寫代碼以便為舉例中的集來分類。因此,下面我們就來講講創(chuàng)建集的代碼。首先,我需要一個(gè)能代表集中的bottle的對(duì)象。為此而編寫的代碼是完全符合標(biāo)準(zhǔn)的,而且事實(shí)上,vb.net 2008 express intellisense會(huì)為你寫好大部分的代碼。以下是我的VB.NET對(duì)象列表:

創(chuàng)新互聯(lián)一直通過網(wǎng)站建設(shè)和網(wǎng)站營(yíng)銷幫助企業(yè)獲得更多客戶資源。 以"深度挖掘,量身打造,注重實(shí)效"的一站式服務(wù),以網(wǎng)站建設(shè)、成都做網(wǎng)站、移動(dòng)互聯(lián)產(chǎn)品、成都全網(wǎng)營(yíng)銷服務(wù)為核心業(yè)務(wù)。10多年網(wǎng)站制作的經(jīng)驗(yàn),使用新網(wǎng)站建設(shè)技術(shù),全新開發(fā)出的標(biāo)準(zhǔn)網(wǎng)站,不但價(jià)格便宜而且實(shí)用、靈活,特別適合中小公司網(wǎng)站制作。網(wǎng)站管理系統(tǒng)簡(jiǎn)單易用,維護(hù)方便,您可以完全操作網(wǎng)站資料,是中小公司快速網(wǎng)站建設(shè)的選擇。
- public class bottle "internalproperties"public property brand() as string
- public property name() as string
- public property category() as string
- public property size() as decimal
- public sub new( _
- end sub
- end class
- 為了創(chuàng)建集,我需要添加項(xiàng)目:
- dim cabinet as list(of bottle) = _ "new list(of bottle)cabinet.add(new bottle( _
- "castle creek", _
- "uintah blanc", _
- "wine", 750))
- cabinet.add(new bottle( _
- "zion canyon brewing company", _
- "springdale amber ale", _
- "beer", 355))
- cabinet.add(new bottle( _
- "spanish valley vineyards", _
- "syrah", _
- "wine", 750))
- cabinet.add(new bottle( _
- "wasatch beers", _
- "polygamy porter", _
- "beer", 355))cabinet.add(new bottle( _
- "squatters beer", _
- "provo girl pilsner", _
- "beer", 355))
所有的這些都是vb.net1.0中的標(biāo)準(zhǔn)代碼。但是,要通過定義我們自己的bottle對(duì)象來注明。我們會(huì)在相同集中的多類型中獲益,大家把VB.NET對(duì)象列表的例子記下來吧。
新聞名稱:深入了解VB.NET對(duì)象列表
當(dāng)前網(wǎng)址:http://m.fisionsoft.com.cn/article/copcipo.html


咨詢
建站咨詢
