#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(); 
}

刷新 DNS

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();
}