あるクラスのループの値を別のクラスに使用しようとしていますが、どうすればよいですか。私を助けてください..
while (!sStreamReader.EndOfStream)
{
string sLine = sStreamReader.ReadLine();
// make sure we have something to work with
if (String.IsNullOrEmpty(sLine)) continue;
string[] cols = sLine.Split(',');
// make sure we have the minimum number of columns to process
if (cols.Length > 4)
{
double a = Convert.ToDouble(cols[1]);
Console.Write(a);
int b = Convert.ToInt32(cols[3]);
Console.WriteLine(b);
Console.WriteLine();
}
}
a と b の値を別のクラスで使用しようとしています。このループは別のクラスです。