本来以为可以像VC++里面一样这样写:
1
public struct content
2
{
3
string title;
4
string author;
5
string contentcontent;
6
string url;
7
}
但是发现通过实例化content 之后
2

3

4

5

6

7

content ok=new content();
无法通过ok取得title等;
后来突然想起来需要将内部元素title等也设置为public,不然的话C#会默认为private了
所以把代码改成:
1
public struct content
2
{
3
public string title;
4
public string author;
5
public string contentcontent;
6
public string url;
7
}

2

3

4

5

6

7

问题解决。