I want to get a count of each english letter in a text file.The lower case and upper case letter should be taken as 1 letter(i.e A and a should be counted as 1 letter).This is my code but it takes capital A ans simple a as 2 letters. Can anyone help?

int[] c = new int[(int)char.MaxValue];
                string file = openFileDialog.FileName;
                    string s = File.ReadAllText(file);
                    foreach (char t in s)
                    for (int i = 0; i < (int)char.MaxValue; i++)
                        if (c[i] > 0 &&
                            Console.WriteLine("Letter: {0}  Frequency: {1}",

Line 1 : You don't have to cast char.MaxValue to an int.
Besides that you can index your string s directly., but before you do that use the ToUpper or ToLower methods of your string object.