我在主程序中向子函数传递一个数组,结果出错了
提示错误:
非静态的字段、方法或属性“TY_GetNew.Program.ReadTy(string, string[*,*], string[*,*])”要求对象引用 D:\MyFile\Studio\C#\TY_GetNew\Program.cs 29 13 TY_GetNew
源代码如下:
namespace TY_GetNew
{
class Program
{
static void Main(string[] args)
{
string[,] allTy = new string[1000,3];
string[,] allTyInfo = new string[50,4]; ReadTy(SaveFileName,allTy,allTyInfo);//从文件中读取资料填充到数组
} void ReadTy(string SaveFileName,string[,] allty,string[,] alltyinfo)
{ }
}
}
提示错误:
非静态的字段、方法或属性“TY_GetNew.Program.ReadTy(string, string[*,*], string[*,*])”要求对象引用 D:\MyFile\Studio\C#\TY_GetNew\Program.cs 29 13 TY_GetNew
源代码如下:
namespace TY_GetNew
{
class Program
{
static void Main(string[] args)
{
string[,] allTy = new string[1000,3];
string[,] allTyInfo = new string[50,4]; ReadTy(SaveFileName,allTy,allTyInfo);//从文件中读取资料填充到数组
} void ReadTy(string SaveFileName,string[,] allty,string[,] alltyinfo)
{ }
}
}
解决方案 »
- C#中,如何在一个窗口中调用另一个窗口中TextBox里已有的值
- 大批量更新数据
- 小白问题
- VS2008中关于Excel的问题
- C#中怎样将文件保存到本地?
- 如何把PictureBox控件的高度和宽度设置成以mm为单位。想和画图一样都以mm为单位,而不是以像素为单位。例如:
- 求一条sql语句,查询2个表,根据其中一个表的数据行数进行排序的问题
- 委托和范型,在C#中如何应用?还有,哪有这方面的资料?
- 求肋(我系新人,多多关照)
- 怎么做用户登录一段时间自动下线的功能?在线等大神帮忙啊
- 急急急:System.Text.Encoding.Default.GetString字符串编码问题
- together 2006 for net 2005
{
Application.Run(new Program());
} public Program()
{
string[,] allTy = new string[1000,3];
string[,] allTyInfo = new string[50,4];
ReadTy(SaveFileName,allTy,allTyInfo);//
} void ReadTy(string SaveFileName,string[,] allty,string[,] alltyinfo)
{ }