Program.cs 783 B

1234567891011121314151617181920212223242526
  1. using System;
  2. namespace ConsoleTest
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. Console.WriteLine("Hello World!");
  9. string t = DateTime.Now.Ticks.ToString();
  10. t = CdkeyHelper.DESEncrypt(t, CdkeyHelper.DesKeyStr);
  11. string[] strid = new string[t.Length];//
  12. for (int i = 0; i < t.Length; i++)//把字符赋给数组
  13. {
  14. strid[i] = t.Substring(i, 1);
  15. }
  16. string s = "";
  17. Random rdid = new Random();
  18. for (int i = 0; i < 25; i++)//从数组随机抽取字符组成新的字符生成机器三
  19. {
  20. s += strid[rdid.Next(0, strid.Length)];
  21. }
  22. Console.WriteLine(s);
  23. }
  24. }
  25. }