Public?Class?Form2

網(wǎng)站建設(shè)哪家好,找成都創(chuàng)新互聯(lián)公司!專注于網(wǎng)頁設(shè)計(jì)、網(wǎng)站建設(shè)、微信開發(fā)、微信小程序開發(fā)、集團(tuán)企業(yè)網(wǎng)站建設(shè)等服務(wù)項(xiàng)目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了普安免費(fèi)建站歡迎大家使用!
Dim?test?As?String
Public?Sub?New(ByVal?_test?As?String)
test?=?_test
End?Sub
End?Class
Form1 中 New Form2("abc") 即可傳參給 Form2 中的 test。
但在 VB.NET 中,沒必要這么麻煩,只需要聲明為 Public,即可直接方法,如:
Public?Class?Form2
Public?test?As?String
End?Class
Form1 中直接 Form2.test = "abc" 即可。
Try
IO.File.ReadAllLines("c:/123.txt")
Catch ex As Exception
MsgBox("文件不存在!")
End Try
Sub Main()
Dim Ispath As String
Console.Write("請(qǐng)輸入目錄:")
Ispath = Console.ReadLine()
Do While (Not Directory.Exists(Trim(Ispath)))
Console.WriteLine("你輸入的目錄不存在,請(qǐng)檢查重新輸入.")
Console.Write("請(qǐng)輸入目錄:")
Ispath = Console.ReadLine()
Loop
Console.WriteLine("目錄為:{0}", Ispath)
Console.ReadLine()
End Sub
網(wǎng)頁標(biāo)題:vb.net跳轉(zhuǎn),vb 出錯(cuò)跳轉(zhuǎn)
當(dāng)前網(wǎng)址:http://chinadenli.net/article8/dsgjgop.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供建站公司、網(wǎng)頁設(shè)計(jì)公司、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站維護(hù)、動(dòng)態(tài)網(wǎng)站、網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)