What I'm trying to do is get two values back to the original section (ParseMessage). .. Right now I'm just focusing on the csvClientReader portion, once I get that working I can get the second part working.
Right now it passes back a single value into strClient, what I really need is for it to pass back the values of:
parsedData[intX][intY] ----- in this case intY would equal 1
parsedData[intX][intY] ----- in this case intY would equal 2
I'm using C# 2005
I'm still cleaning up some of the code so please bare with me as I'm still fairly new to C#... Thank you in advance...
Right now it passes back a single value into strClient, what I really need is for it to pass back the values of:
parsedData[intX][intY] ----- in this case intY would equal 1
parsedData[intX][intY] ----- in this case intY would equal 2
I'm using C# 2005
I'm still cleaning up some of the code so please bare with me as I'm still fairly new to C#... Thank you in advance...
Code:
void ParseMessage(string strCompleteMsg, string strCheckForSubject)
{
string strFileName = "";
Int16 intFound = 0;
string strClient = "";
string strSubject;
//Call ClientReader to get information about file from strCheckForSubject
strClient = csvClientReader(strClient, strSubject = strCheckForSubject);
strFileName = strClient;
string strOne = "";
strOne = csvFileReader(strFileName, strOne);
}
public string csvClientReader(string strSubject, string strClient)
{
using (StreamReader readFile = new StreamReader("M:\\pgtreg\\MailLog\\clients\\clientList.csv"))
{
string line;
string[] row;
int intY = 1;
int intX = 0;
string strChkClient = "";
List<string[]> parsedData = new List<string[]>();
while ((line = readFile.ReadLine()) != null)
{
row = line.Split(',');
parsedData.Add(row);
strChkClient = parsedData[intX][0];
if (strClient.Contains(strChkClient))
{
strClient = parsedData[intX][intY];
}
intX++;
}
intX--;
return strClient;
}
}
Comment