程序这样写的namespace _007_B
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} public int num;
public string currentStation1;
public char[] changeStation = new char[5];
public bool isReached; public void Form1_Load(object sender, EventArgs e)
{
button1.Left = (this.Width - button1.Width) / 2;
Init();
} public void Init()
{
Station[] stations = new Station[3996];
//在这里给数组的成员赋值
Find(stations);
} public void Find(Station[] stations)
{
label1.text=stations[0].Text;
}
}
}
编译的时候告诉我参数类型_007_B.Station[]比_007_B.Form1.Find(_007_B.Station[])方法的可见性低。这什么意思啊?我明天早上交作业,高手快来救救我吧,分全给你们了!
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} public int num;
public string currentStation1;
public char[] changeStation = new char[5];
public bool isReached; public void Form1_Load(object sender, EventArgs e)
{
button1.Left = (this.Width - button1.Width) / 2;
Init();
} public void Init()
{
Station[] stations = new Station[3996];
//在这里给数组的成员赋值
Find(stations);
} public void Find(Station[] stations)
{
label1.text=stations[0].Text;
}
}
}
编译的时候告诉我参数类型_007_B.Station[]比_007_B.Form1.Find(_007_B.Station[])方法的可见性低。这什么意思啊?我明天早上交作业,高手快来救救我吧,分全给你们了!
解决方案 »
- .net 反编译 用什么反编译工具能将一个dll反编译成一个个类导出来呢?
- 请教,防止二重启动的问题,急。。。
- VSTO开发的Outlook插件如何部署到客户端机器上?
- 怎么将C#做的程序运行在没有没有Framwork的环境下
- 各位大侠,我做了一个网站,但客户不想敲网址的方式来找开,而想直接在桌面上有个图标,点那个图标就弹开主页,且不显示访问的路径。请教
- 新人求解
- File.delete(@"c:\1.txt")报没有权限的错误
- 求 c# 模拟登录 万网开放管理平台,先谢谢
- 稍微复杂点的问题,请大神看过来
- 如何替换程序安装时候会自动在[控制面板]->[添加/删除应用程序]里添加的默认图标?
- interface问题
- 关于c#正则表达式-------------菜鸟问题
{
Station[] stations = new Station[3996];
//在这里给数组的成员赋值
string station = stations[0].Text;(如果这里已经赋完值了)
Find(station);
}public void Find(string station)
{
label1.text=station;
}
LZ试试这样行不行?
而_007_B.Form1.Find可见性为 public。
public void Init()
{
Station[] stations = new Station[3996];
//在这里给数组的成员赋值
Find(stations);
}这里吧 Station[] stations 拿出来变全局变量看看怎么样 ?Station[] stations ;
public void Init()
{
stations = new Station[3996];
//在这里给数组的成员赋值
Find(stations);
}
{
InitializeComponent();
} public int num;
public string currentStation1;
public char[] changeStation = new char[5];
public bool isReached;
大哥 麻烦你 把 构造 方变量申明后面 好不
有哪位高手能讲讲为什么要这样写,我这样写了之后生成的form对象里stations是什么类型的?是public还是private?
还有个问题,链接在下面,都没人来解答啊我加分了,高手来领分了!
http://topic.csdn.net/u/20070921/13/c21bb2c7-6b56-4827-9283-e96187e70595.html
因为你要向大家公开的东西不能是人家不想让你公开的东西。Station[] stations = new Station[3996];
这个stations 是个局部变量,没有什么public或者privatepublic void Find(Station[] stations)
这个stations是个参数,而Find是public的,所以Station也要是public的