本文整理汇总了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);
}
}
示例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);
}
示例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();
}
示例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);
}