简体   繁体   English

编译器错误C#

[英]Compiler Errors C#

        client.MessageRecieved += new EasyTCPClient.StringCarrier(this.client_MessageRecieved);
        client.OnConnectionLost += new EasyTCPClient.OnConnectionLostHandler(this.client_OnConnectionLost);
        client.Error += new EasyTCPClient.ErrorCarrier(this.client_Error);

I get the error messages: 我收到错误消息:

'EasyTCP.EasyTCPClient.OnConnectionLost' is inaccessible due to its protection level 'EasyTCP.EasyTCPClient.MessageRecieved' is inaccessible due to its protection level 'EasyTCP.EasyTCPClient.Error' is inaccessible due to its protection level 由于其保护级别'EasyTCP.EasyTCPClient.MessageRecieved'由于其保护级别而无法访问'EasyTCP.EasyTCPClient.MessageRecieved'由于其保护级别而无法访问'EasyTCP.EasyTCPClient.Error'由于其保护级别而无法访问

I'm fairly new to C# so any help given would be greatly appreciated, thanks. 我对C#还是很陌生,所以非常感谢您提供的任何帮助。 -Neel. -Neel。

The error message indicates you are trying to access a member with private or protected visibility, which is not allowed. 错误消息表明您正在尝试访问具有私有或受保护的可见性的成员,这是不允许的。

This library is not part of .net and so it's hard for me to work out how it is meant to be used. 该库不是.net的一部分,因此对我来说很难确定其用法。 I can't immediately find any documentation. 我无法立即找到任何文档。

Those errors mean that those events are either private or protected modifiers on. 这些错误意味着这些事件是privateprotected修饰符。 Its hard to know how this library is designed. 很难知道这个库是如何设计的。

Same with your BabbelenControls . 与您的BabbelenControls相同。

将方法更改为public以便在另一个类中使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM