zoukankan      html  css  js  c++  java
  • Textbox像百度一下实现下拉显示 z

    List<string> Data = new List<string>();
    
            string Randomstr = "功夫撒黑胡椒hcbvf蜂窝qwertyuiopasdfghjklzxcvbnm法国的恢复到飞范德萨QWERTYUIOPASDFGHJKLZXCVBNM出现过热423贴①46546也有一头热刚恢复到贴3天赋如头3广泛的我让他";
    
    
            Random rd = new Random(GetRandomSeed());
    
            static int GetRandomSeed()
            {
                byte[] bytes = new byte[4];
                System.Security.Cryptography.RNGCryptoServiceProvider rng = new System.Security.Cryptography.RNGCryptoServiceProvider();
                rng.GetBytes(bytes);
                return BitConverter.ToInt32(bytes, 0);
            }
            public Form1()
            {
                InitializeComponent();
    
    
                for (int i = 0; i < 20000000; i++)
                {
                    Data.Add(Randomstr.ToCharArray()[rd.Next(Randomstr.Length)].ToString()
                        + Randomstr.ToCharArray()[rd.Next(Randomstr.Length)].ToString()
                        + Randomstr.ToCharArray()[rd.Next(Randomstr.Length)].ToString()
                        + Randomstr.ToCharArray()[rd.Next(Randomstr.Length)].ToString()
                        + Randomstr.ToCharArray()[rd.Next(Randomstr.Length)].ToString());
                }
    
                this.textBox1.AutoCompleteCustomSource.Clear();
                this.textBox1.AutoCompleteCustomSource.AddRange(Data.ToArray());
                this.textBox1.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
                this.textBox1.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
    
            }
    

     面是2000W数据加载后的效果

  • 相关阅读:
    python字符串以单词形式反转
    python if 语句的练习
    Python对元祖的操作
    Python对列表的操作
    Python对字符串的操作
    导出EXCEL【Web方式HTML通过拼接html中table】
    链接点击跳动问题
    maven报uri is not registered错误
    maven配置
    三级分类的sql语句
  • 原文地址:https://www.cnblogs.com/zeroone/p/4176841.html
Copyright © 2011-2022 走看看