0

我正在尝试调用一个函数,但我得到的错误是“xxxx 的最佳重载方法匹配有一些无效参数”。当我将鼠标悬停在它上面时,我可以选择“生成方法存根...”

导致错误的代码是:

if (oCustomerDAL.VerifyCustomerLoginID(ref oSubscriber))    { }  

相关函数为:

public bool VerifyCustomerLoginID(ref IAuthenticate oSystemUser)  

如何解决错误?

4

2 回答 2

5
if (oCustomerDAL.VerifyCustomerLoginID(ref oSubscriber))    { }  
于 2012-06-28T13:58:09.010 回答
2

as the method uses the ref keyword, you need to also provide it when calling the method:

if (oCustomerDAL.VerifyCustomerLoginID(ref oSubscriber))    { }  

(OP omited the ref before edit)


Edit. You should also check what type oSubscriber is. Ensure that it implements interface IAuthenticate as this is the interface that the method you're trying to call requires.

To do this find the definition of the class for which oSubscriber is an instance and ensure that it looks something like this (C#)

public class Subscriber : IAuthenticate
{
   ...
}
于 2012-06-28T13:58:34.917 回答