byte myValue = fileMemBufferIn.GetCurrentByte
char convertValue = Convert.ToChar(myValue);
//Select is a string type
Select += Convert.ToString(convertValue);
i use this to check the string to see if its in the correct
format
if(Regex.Match(Select,@"((&|;)\d+(&|;))+[A-Za-z]{1}").Success)
then i get each of the parameters from command:
public bool GetCommand(string headerValue)
{
paramCount = 0;
Regex SeperateParams = new Regex(@"(&|;)\d+((&|;) | (&[a-zA-Z]))*");
foreach(Match myMatches in SeperateParams.Matches(headerValue))
{
string values = myMatches.Value.ToString();
values = Regex.Replace(values,@"&","");
values = Regex.Replace(values,@";","");
values = Regex.Replace(values,@"[A-Za-z]","");
HeaderParameters[paramCount] = int.Parse(values);
paramCount++;
}
this.GetParameter1 = HeaderParameters[0];this.GetParameter2 =
HeaderParameters[1];this.GetParameter3 =
HeaderParameters[2];this.GetParameter4 = HeaderParameters[3];
for(int t = 0;t < 4;t++)
{
HeaderParameters[t] = -1;
}
return true;
return false;
}
The commands i read in are in the format
"&Param1;Param2;Param3.....&a(Some character from a-z)
*** Sent via Devdex
http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!