c# - WinForms 中的部分类

标签 c# multithreading

我在集成这个极其出色的解决方案时遇到了麻烦 enter link description here在我将同时读取/写入数据的 winform 应用程序中。我有编译错误: 第一:错误 CS0262“客户端”的部分声明具有冲突的可访问性修饰符
第二:错误 CS0535 'Client' does not implement interface member 'IDisposable.Dispose()'
在这部分代码中,它是红色高亮的:

 public sealed partial class Client : IDisposable

最佳答案

第一个错误是因为您的 Client 类具有可访问性不同的 Partial 类。例如如果你有以下内容,你会得到同样的错误:

public partial class MyClassName
{
    //rest of code
}

protected partial class MyClassName
{
    //rest of code
}

类在同一个命名空间中。它们应该都是 public 或都是 protected

关于c# - WinForms 中的部分类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37258711/

相关文章:

c# - WCF 静态变量在每次调用时重置

ios - 如何在同一个全局队列中添加后台任务?

python - grpc server 中 ThreadPoolExecutor 的作用是什么?

java - 如何将 SQLiteOpenHelper 作为单个原子事务进行多次调用?

C#/MonoTouch : how to call an async method when a ViewController is created/appears

c# - 动态对象转换为仅在运行时已知的类型

c# - 使用 WebDriver 的 javascript 出现一些错误

c# - .NET 垃圾分析 : calculate how much garbage a piece of code is making

c# - 在打开表单之前使用 Invoke 时出现 InvalidOperationException

c# - 线程(这些线程是否自行退出或中止?)