Weird logical flaw
I have this following code that has a logical flaw which I could not figure out where the problem lies:

The following is a method being executed:

     public static void interpret(string inServer){
    	string currLine;
                string currControlID;
    
        

        StreamReader sr = new StreamReader(@".\Input\" + inServer + ".txt");

            while (sr.Peek() >= 0)
            {
                currLine = sr.ReadLine();


                if (currLine.Contains("============================"))
                {
                    currLine = sr.ReadLine();
                    currControlID = Regex.Replace(currLine, "Control ", "");
                    currLine = Regex.Replace(currControlID, ":", "");
                    currControlID = currLine.Trim();

                    sr.ReadLine();

                    Console.WriteLine("Processing Control ID: " + currControlID);
                    processControl(sr, inServer, int.Parse(currControlID));
                }
            }

}

The following is the code of the method 'processControl'

    public static void processControl(StreamReader sr, string inServer, int inControl)
            {
                //local variables
                StringComparison ignoreCase = StringComparison.OrdinalIgnoreCase;
                string currLine;
                string numResults;
                string case1 = "";
                DataRow changeRow = dTable.Rows.Find(inControl.ToString());
    
                try
                {
                    changeRow[inServer + " Exception"] = "";
                }
                catch
                {
                    return;
                }
    
    
                

    currLine = sr.ReadToEnd();
                string[] splited = Regex.Split(currLine, "~~~~~~~~~~~~~~");
                Console.WriteLine(case1);

            switch (inControl)
            {
                
                case 127232:
		dosomething();
		break;
		
		case 127232:
		dosomething();
		break;
	}


So the following output was the problem (Control ID 127235 was missing in the output):

    Processing Control ID : 127232

I'm not sure whether is it my case have a issue or the while loop ?

thanks! (i know this code is a little bit long)
Weird logical flaw
===

I have this following code that has a logical flaw which I could not figure out where the problem lies:

The following is a method being executed:

     public static void interpret(string inServer){
    	string currLine;
                string currControlID;
    
        

        StreamReader sr = new StreamReader(@".\Input\" + inServer + ".txt");

            while (sr.Peek() >= 0)
            {
                currLine = sr.ReadLine();


                if (currLine.Contains("============================"))
                {
                    currLine = sr.ReadLine();
                    currControlID = Regex.Replace(currLine, "Control ", "");
                    currLine = Regex.Replace(currControlID, ":", "");
                    currControlID = currLine.Trim();

                    sr.ReadLine();

                    Console.WriteLine("Processing Control ID: " + currControlID);
                    processControl(sr, inServer, int.Parse(currControlID));
                }
            }

}

The following is the code of the method 'processControl'

    public static void processControl(StreamReader sr, string inServer, int inControl)
            {
                //local variables
                StringComparison ignoreCase = StringComparison.OrdinalIgnoreCase;
                string currLine;
                string numResults;
                string case1 = "";
                DataRow changeRow = dTable.Rows.Find(inControl.ToString());
    
                try
                {
                    changeRow[inServer + " Exception"] = "";
                }
                catch
                {
                    return;
                }
    
    
                

    currLine = sr.ReadToEnd();
                string[] splited = Regex.Split(currLine, "~~~~~~~~~~~~~~");
                Console.WriteLine(case1);

            switch (inControl)
            {
                
                case 127232:
		dosomething();
		break;
		
		case 127232:
		dosomething();
		break;
	}


So the following output was the problem (Control ID 127235 was missing in the output):

    Processing Control ID : 127232

I'm not sure whether is it my case have a issue or the while loop ?

thanks! (i know this code is a little bit long)