Generate random strings

xiaoxiao2021-03-06  55

///

/// Get random strings /// /// string length /// Random Function Seed Value //// Specified random string public static string rndstring (int length, params int [] seed) {string strsEp = ","; char [] chrsep = STRSEP.TOCHARARRAY ();

// The character set String strChar = "0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 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 " ", A, B, C, D, E, F, G, H , I, J, K, L, M, N, O, P, Q, R, S, T, U, W, X, Y, Z ";

String [] Arychar = STRCHAR.SPLIT (Chrsep, Strchar.length);

String strrandom = string.empty; random rnd; if (seed! = null && seed.length> 0) {rND = new random (seed [0]);} else {rND = new random ();

/ / Generate a random string for (int i = 0; i

Return Strrandom;

转载请注明原文地址:https://www.9cbs.com/read-90215.html

New Post(0)