random - Randomly generated hexadecimal number in C# -


How can I generate a random hexadecimal number with the length of my choice using C #?

  static random random = new random (); Public static string GetRandomHexNumber (int issue) {byte [buffer = new byte [number / 2]; Random.NextBytes (buffer); String result = string.concat (select buffer (x => x.ToString ("X2"). ToArray ()); If returns (number% 2 == 0) returns results; Return Results + Random Next (16). Ostring ("X"); }  

Comments

Popular posts from this blog

SQL/PHP: Table design question -

c# - PInvoke of NetUserAdd returns 24 -

NHibernate Passing Session to the Repository -