我一直收到这个错误:
Error 1 Cannot implicitly convert type 'System.IO.Stream' to 'Project_Jynx.Stream' C:\Users\User\Desktop\Project jynx W.I.P EXPLOIT\Project_Jynx\Project_Jynx\Form1.cs 27 Project_Jynx.
我需要帮助解决这个问题,因为我想完成这个编码。
最佳答案
显然,您在项目中定义了一个 Stream
类。编译器不知道您实际上指的是 System.IO.Stream
。当它看到这一行时,它以为你指的是项目中的 Stream
:
Stream stream;
然后您将返回一个 System.IO.Stream
的 openFileDialog.OpenFile()
分配给它。
要告诉编译器使用System.IO.Stream
,只要在前面写上System.IO.
即可:
System.IO.Stream stream;
关于c# - 错误无法将类型 'System.IO.Stream' 隐式转换为 'Project_Jynx.Stream',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46083123/