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)