c#到vb.net如何继承多个类?Can';我不能改变它。SharpDevelop也失败了

c#到vb.net如何继承多个类?Can';我不能改变它。SharpDevelop也失败了,c#,vb.net,class,sharpdevelop,c#-to-vb.net,C#,Vb.net,Class,Sharpdevelop,C# To Vb.net,我试图将此代码从c#转换为vb.net,但总是失败,因为vb.net不允许将多个类继承到一个类中 如何解决这个问题 以下是c#代码: 感谢您的帮助。转换器应该能够推断出第2和第3个基址是接口(在op的进一步提示后还添加了“AddressOf”): sIAuthPrompt、nsIAuthPrompt2是非类接口,C#也不允许继承多个类。一切都一样,谢谢你!我已经知道了,但是我得到了一个错误:参数'aPassword'的'Sub-SetPasswordAttribute(aPassword作为ns

我试图将此代码从c#转换为vb.net,但总是失败,因为vb.net不允许将多个类继承到一个类中

如何解决这个问题

以下是c#代码:

感谢您的帮助。

转换器应该能够推断出第2和第3个基址是接口(在op的进一步提示后还添加了“AddressOf”):


sIAuthPrompt、nsIAuthPrompt2是非类接口,C#也不允许继承多个类。一切都一样,谢谢你!我已经知道了,但是我得到了一个错误:参数'aPassword'的'Sub-SetPasswordAttribute(aPassword作为nsAStringBase)'没有指定,它似乎是nsString.Set将委托作为第一个参数-如果这是真的(并且转换器无法通过您的C#代码段知道这一点),将nsString.Set调用的第一个参数更改为“AddressOf authInfo.SetUsernameAttribute”。我已经更新了我的答案以反映这种可能性。太好了,很好!!非常感谢你的帮助!
 public class MyPromptService : PromptService, nsIAuthPrompt, nsIAuthPrompt2
{
   nsICancelable nsIAuthPrompt2.AsyncPromptAuth(nsIChannel aChannel, nsIAuthPromptCallback aCallback, nsISupports aContext, uint level, nsIAuthInformation authInfo)
    {
       throw new NotImplementedException();

    }

    bool nsIAuthPrompt2.PromptAuth(nsIChannel aChannel, uint level, nsIAuthInformation authInfo)
    {
        nsString.Set(authInfo.SetUsernameAttribute, "Username");
        nsString.Set(authInfo.SetPasswordAttribute, "Password");
        return true;
    }
}
Public Class MyPromptService
    Inherits PromptService
    Implements nsIAuthPrompt, nsIAuthPrompt2

    Private Function nsIAuthPrompt2_AsyncPromptAuth(ByVal aChannel As nsIChannel, ByVal aCallback As nsIAuthPromptCallback, ByVal aContext As nsISupports, ByVal level As UInteger, ByVal authInfo As nsIAuthInformation) As nsICancelable Implements nsIAuthPrompt2.AsyncPromptAuth
       Throw New NotImplementedException()

    End Function

    Private Function nsIAuthPrompt2_PromptAuth(ByVal aChannel As nsIChannel, ByVal level As UInteger, ByVal authInfo As nsIAuthInformation) As Boolean Implements nsIAuthPrompt2.PromptAuth
        nsString.Set(AddressOf authInfo.SetUsernameAttribute, "Username")
        nsString.Set(AddressOf authInfo.SetPasswordAttribute, "Password")
        Return True
    End Function
End Class