gpt4 book ai didi

C# 错误 CS0052,可访问性不一致

转载 作者:太空宇宙 更新时间:2023-11-03 18:31:11 27 4
gpt4 key购买 nike

当我尝试编译以下代码时出现 CS0052 错误:

struct mp3
{
public int ID, MBSize;
public string Make, Model, Price;

public mp3(int ID, int voorraad, int MBSize, string Make, string Model, string Price)
{
this.ID = ID;
this.MBSize = MBSize;
this.Make = Make;
this.Model = Model;
this.Price = Price;
}
}

public class Acess
{
static public List<mp3> mp3List = new List<mp3>();

static public void laadMP3()
{
// ...
}
}

Error 1 Inconsistent accessibility: field type 'System.Collections.Generic.List' is less accessible than field 'SoundSharp___opdracht_3.Acess.mp3List'

最佳答案

我认为的问题是struct mp3应声明为 public (你有一个公共(public) List<mp3> )

关于C# 错误 CS0052,可访问性不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22210667/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com