2011-11-23 86 views
0

這個問題是關於一個不同的實例,即時通訊試圖實例...... 我必須從我的讀卡器類獲得「閱讀」功能和一個字符串返回到它的Form1.vb的....現在我做了我可以記住的東西,但出於某種原因,我對托架有問題....我能做些什麼來解決這個問題?實例化功能

Form1.vb的

ThisATM.getCardReader.Readr("TEST TEXT IS FUN") 

CardReader.vb

Public Function Readr(ByVal card As KeyCard) As String 
     Return Read 
    End Function 

Link for the image of the card reader function. I thought this link of the image of the code would be easier to understand.

+0

我tryed使用intellsense的想法這是自動把一些隨機代碼' Sub Readr(ByVal p1 As String) Throw New NotImplementedException End Sub '我不認爲這是正確的 – Star1654

+0

只是嘗試使'read'作爲一個字符串,並把'card作爲keycard'在別的地方...沒有工作,我想我使情況變得更糟.... – Star1654

回答

1

的Readr函數接受一個鑰匙卡作爲參數,而不是字符串。所以看起來你必須爲KeyCard創建一個實例,並將其用作參數。在你提供你所創建的卡式鑰匙對象的圖像中的代碼,就好像你應該在Readr功能像這樣使用該對象:

Dim ThisKeyCard as new KeyCard("1234","5678","Mikki Monster") 
Dim returnString as string=ThisATM.getCardReader.Readr(ThisKeyCard)