Q:

Having upper case, lower case and digits in a GUID

Possible Duplicate:
generating GUID without hyphen 

I am creating a GUID with the following piece of code
 byte[] keyBytes = Encoding. UTF8.GetBytes(Guid. NewGuid().ToString("N").Substring(0, 9));

The end result is a GUID that contains lower cased chars and numbers.  I am trying to have upper case, lower case and numbers, all in one GUID.  And I dont want hyphen char within the generated GUID.  Can anyone suggest me an idea?  

A:

Concerning your comment:

i just wish to generate a random guid value with upper, lower and
  numbers...

Something like this could be done
var rand = new Random();
var sb = new StringBuilder();

foreach (char c in Guid. NewGuid().ToString("N"))
{
    sb. Append(rand. Next(0, 2) == 1 ?  Char. ToUpper(c) : c);
}

Not giving any guarantees about the quality about the "randomness" of upper/lowercase characters.