当前位置: 首页>>代码示例>>C#>>正文


C# ListViewItem.ToString方法代码示例

本文整理汇总了C#中System.Windows.Forms.ListViewItem.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ListViewItem.ToString方法的具体用法?C# ListViewItem.ToString怎么用?C# ListViewItem.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ListViewItem的用法示例。


在下文中一共展示了ListViewItem.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculateStats

        public void CalculateStats()
        {
            tbCount.Text = tbCipher.Text.Trim().Length + "/" + tbCipher.Text.Trim().Replace(" ", "").Length;

            StringBuilder factors = new StringBuilder();
            for (int i = 2; i < Math.Sqrt(tbCipher.Text.Trim().Length); i++)
            {
                if (tbCipher.Text.Trim().Length % i == 0)
                {
                    factors.Append(i);
                    factors.Append(",");
                }
            }
            if (factors.Length == 0)
            {
                tbFactors.Text = "Prime";
            }
            else
            {
                factors.Length--;
                tbFactors.Text = factors.ToString();
            }
            tbHasJ.Text = ((tbCipher.Text.IndexOf("j") >= 0 || tbCipher.Text.IndexOf("J") >= 0) ? "Yes" : "");
            tbHasPound.Text = ((tbCipher.Text.IndexOf("#") >= 0) ? "Yes" : "");
            tbHasNumbers.Text = ((tbCipher.Text.IndexOf("0") >= 0 || tbCipher.Text.IndexOf("1") >= 0 || tbCipher.Text.IndexOf("2") >= 0 || tbCipher.Text.IndexOf("3") >= 0 || tbCipher.Text.IndexOf("4") >= 0
                || tbCipher.Text.IndexOf("5") >= 0 || tbCipher.Text.IndexOf("6") >= 0 || tbCipher.Text.IndexOf("7") >= 0 || tbCipher.Text.IndexOf("8") >= 0 || tbCipher.Text.IndexOf("9") >= 0) ? "Yes" : "");

            tbIC.Text = CryptSharp.Utility.IndexOfCoincidence(tbCipher.Text, tbUsedAlphabet.Text).ToString();

            lvFrequencies.Items.Clear();
            Dictionary<char, int> frequencies = CryptSharp.Utility.Frequencies(tbCipher.Text.ToCharArray(), tbUsedAlphabet.Text.ToCharArray());
            foreach (char c in frequencies.Keys)
            {
                ListViewItem i = new ListViewItem();

                i.Text = c.ToString();
                i.SubItems.Add(frequencies[c].ToString());

                lvFrequencies.Items.Add(i);
            }

            lvICByKeyLength.Items.Clear();
            for (int i = 1; i < tbCipher.Text.Trim().Length / 2; i++)
            {
                ListViewItem item = new ListViewItem();

                item.Text = i.ToString();
                item.SubItems.Add(CryptSharp.Utility.AvgVigenereIndexOfCoincidence(tbCipher.Text.Trim(), tbUsedAlphabet.Text, i).ToString());

                lvICByKeyLength.Items.Add(item);
            }
        }
开发者ID:CryptoTrick,项目名称:CryptSharp,代码行数:52,代码来源:Form1.cs

示例2: treeView1_NodeMouseDoubleClick

        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            axWindowsMediaPlayer1.Ctlcontrols.stop();

            TreeNode selnode = e.Node;
            int i = selnode.Index;
            string[] s = new string[list[i].Items.Count];
            lb2.Items.Clear();
            listView2.Items.Clear();
            listView1.Items.Clear();
            ds.Items.Clear();

            for (int j = 0; j < list[i].Items.Count; j++)
            {
                s[j] = list[i].Items[j].ToString();
                lb2.Items.Add(s[j]);
                listView2.Items.Add(Path.GetFileNameWithoutExtension(s[j]));
            }

            plItems = axWindowsMediaPlayer1.playlistCollection.getByName(myPlaylist);
            if (plItems.count == 0)
            {
                pl = axWindowsMediaPlayer1.playlistCollection.newPlaylist(myPlaylist);
            }
            else
            {
                pl = plItems.Item(0);
            }
            int q = 0;
            foreach (string file in s)
            {
                ListViewItem item = new ListViewItem(s[q]);
                ds.Items.Add(Path.GetFileNameWithoutExtension(item.ToString()));
                q++;
                m1 = axWindowsMediaPlayer1.newMedia(file);
                pl.appendItem(m1);
            }

            //choi nhac
            axWindowsMediaPlayer1.currentPlaylist = pl;
            axWindowsMediaPlayer1.Ctlcontrols.play();
            axWindowsMediaPlayer1.playlistCollection.remove(pl);
        }
开发者ID:fordream,项目名称:store-vnp,代码行数:43,代码来源:Form1.cs

示例3: button7_Click

        private void button7_Click(object sender, EventArgs e)
        {
            //SELECT 列名 FROM テーブル名 where 列名 LIKE '探索文字';

            //オブジェクト指向パラダイム
            MySqlConnection con = new MySqlConnection();
            string conString = ConfigurationManager.ConnectionStrings["conString"].ConnectionString;
            con.ConnectionString = conString;

            try
            {
                con.Open();
                //MessageBox.Show("接続成功");
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message);

            }

            foreach (ListViewItem itemx in listView1.CheckedItems)
            {
                string msg = itemx.Text;
                //MessageBox.Show("チェックが付いている項目は" + msg);

                // SELECT文出す
                StringBuilder sql = new StringBuilder();

                sql.AppendLine("SELECT importance FROM content WHERE id LIKE '" + msg + "'");

                // よみこむやつ
                MySqlCommand cmd = new MySqlCommand(sql.ToString(), con);
                MySqlDataReader reader = cmd.ExecuteReader();

                while (reader.Read())
            {

                string importance = reader.GetString("importance");

                ListViewItem itemx1 = new ListViewItem();

                itemx1.SubItems.Add(importance);         //重要度

                    string txtimportance = itemx1.ToString();

                    textBox4.Text = importance;

                }

            }

            //最後にとじる
            con.Close();
        }
开发者ID:Quantum-ozaki,项目名称:TODOList,代码行数:54,代码来源:Form1.cs

示例4: CreatePlayLis

        private void CreatePlayLis(OpenFileDialog open, ListView lv)
        {
            plItems = axWindowsMediaPlayer1.playlistCollection.getByName(myPlaylist);

            if (plItems.count == 0)
                pl = axWindowsMediaPlayer1.playlistCollection.newPlaylist(myPlaylist);
            else
                pl = plItems.Item(0);

            //them vao listview va thu vien WMP

            int i = 0;
            foreach (string file in open.FileNames)
            {
                ListViewItem item = new ListViewItem(open.FileNames[i]);
                lv.Items.Add(Path.GetFileNameWithoutExtension(item.ToString()));
                i++;
                m1 = axWindowsMediaPlayer1.newMedia(file);
                pl.appendItem(m1);
            }

            //choi nhac
            axWindowsMediaPlayer1.currentPlaylist = pl;
            axWindowsMediaPlayer1.Ctlcontrols.play();
            axWindowsMediaPlayer1.playlistCollection.remove(pl);
        }
开发者ID:fordream,项目名称:store-vnp,代码行数:26,代码来源:Form1.cs


注:本文中的System.Windows.Forms.ListViewItem.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。