PHP-Code:
static class RandomString {
        static 
string[] chars = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V",
                                 
"W", "X", "Y", "Z"};
        static 
Random random = new Random();
        public static 
string Generate(int length) {
            
string toReturn = "";

            for (
int i = 0; i < length; i++) {
                
int value = random.Next(0, 26);
                
toReturn += value % 2 == 0 ? chars[value] : chars[value].ToLower();
            }
            return 
toReturn;
        }
    }