0

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 by Khoo: Add more specific details

4
Contributors
3
Replies
25
Views
3 Years
Discussion Span
Last Post by KM499
Featured Replies
  • 1
    ddanbe 2,525   3 Years Ago

    > '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. Read More

1

'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.

0

Hi,

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

Edited by The Diamonds

1

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 topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.