C#打乱数组
一种打乱数组的方法
Random r = new Random();
for (int i = 0; i < paras.Count; i++)
{
int j = i + r.Next(paras.Count - i);
object t = paras[j];
paras[j] = paras[i];
paras[i] = t.ToString();
}
一种打乱数组的方法
Random r = new Random();
for (int i = 0; i < paras.Count; i++)
{
int j = i + r.Next(paras.Count - i);
object t = paras[j];
paras[j] = paras[i];
paras[i] = t.ToString();
}
using (System.Diagnostics.Process process = new System.Diagnostics.Process())
{
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
startInfo.Arguments = "ipconfig /flushdns";
process.StartInfo = startInfo;
process.Start();
}
添加新项>常规>应用程序清单文件
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />