class testclass
{
class mycla
{
string name;
string pw;
}
static string FileName = ".\\data\\data.csv";
static List<String[]> ls = CSVUtil.ReadCSV(Form1.FileName);
static Row[] rarry = new Row[ls.Count];
public void userlist(string name)
{
for (int i = 1; i < ls.Count; i++)
{ //update data
rarry[i] = new Row(); String[] strArr = ls[i];
// rarry[i] = new Row();
rarry[i].Column1 = Int32.Parse(strArr[0]);
rarry[i].Column2 = strArr[1];
rarry[i].Column3 = strArr[2];
rarry[i].Column4 = strArr[3];
index = rowNumber++;
}
} }我想rarry[i]数组在其他地方使用
怎么做??
{
class mycla
{
string name;
string pw;
}
static string FileName = ".\\data\\data.csv";
static List<String[]> ls = CSVUtil.ReadCSV(Form1.FileName);
static Row[] rarry = new Row[ls.Count];
public void userlist(string name)
{
for (int i = 1; i < ls.Count; i++)
{ //update data
rarry[i] = new Row(); String[] strArr = ls[i];
// rarry[i] = new Row();
rarry[i].Column1 = Int32.Parse(strArr[0]);
rarry[i].Column2 = strArr[1];
rarry[i].Column3 = strArr[2];
rarry[i].Column4 = strArr[3];
index = rowNumber++;
}
} }我想rarry[i]数组在其他地方使用
怎么做??
未处理 NullReferenceException
{
pulic static Row[] Rassy
{ get{return rarry ;}}
}testclass tnew = new testclass ();
tnew.userlist(testclass.FileName);
//
testclass.Rarry ;这样就行了吧