Hello, I got a error 'Does not implement interface member'
I search around the net and try a lots of solutions, both did not works for me.
How can I fix this problem ?
'Browser.CoreServer' does not implement interface member 'browser.iDataConnection.tcpclient'
...

namespace Browser
{

    public interface iDataConnection
    {
        TcpClient tcpclient { get; set; }
        StreamReader streamReader_connect { get; set; }
        StreamWriter streamWriter_connect { get; set; }
        NetworkStream networkStream_connect { get; set; }
    }

    public class CoreServer : iDataConnection    <-- Error at this line
    {
        iDataConnection dc = new CoreServer();
    }

    public partial class Browser : Form
    {}
}

Edited 2 Years Ago by Khoo: Add more specific details

'Browser.CoreServer' does not implement interface member

This says it all.
If you your class derives from an interface, it MUST implement ALL the interface members.

Hi,

Since you want to add properties to your interface, why don't you convert it to 'abstract class' instead?

Edited 2 Years Ago by The Diamonds

Try using the following code :-

namespace Browser
{

    public abstract class iDataConnection
    {
        TcpClient tcpclient { get; set; }
        StreamReader streamReader_connect { get; set; }
        StreamWriter streamWriter_connect { get; set; }
        NetworkStream networkStream_connect { get; set; }
    }

    public class CoreServer : iDataConnection
    {
        iDataConnection dc = new CoreServer();
    }

    public partial class Browser : Form
    {}
}

Hope that helps :)

This article has been dead for over six months. Start a new discussion instead.