01 2020 档案
摘要:/// /// 转换成时间 00:00:00/// /// /// public string time(long duration){ TimeSpan t = new TimeSpan(0, 0, Convert.ToInt32(duration)); //string str = "00:00:00"; return $"{t.Hours:00}:{t.Minutes:...
阅读全文
摘要:像sql数据链接字符串不能出现的特殊字符 单引号‘、双引号“、斜杠\、大于号>、 " 编码后 [ə'prɑksɪmət] < > "通过使用 HttpUtility类 实现上面2种编码与转换//需要引用using System.Web;//解码textBox1.Text = HttpUtility.HtmlEncode(textBox1.Text);//编码text...
阅读全文
摘要:using System;using System.Collections;using System.Linq;namespace ConsoleApp1 { class Program { static void Main(string[] args) { string[] array = { "a.m.", "a", "Smith", "Jones",...
阅读全文
摘要:2020年1月9日 17:50:55附件https://files.cnblogs.com/files/xe2011/ListBoxSort.rar这种方法 如果内容足够多就能看到滚动条闪烁了,我觉得这是列表框清除内容,再添加内容引起的。用不删除列表,重新赋值的方法能解释闪烁,但过程时间又太长。using System;using System.Collections.Generic;using ...
阅读全文
摘要:string s = "";foreach (DataGridViewRow item in dataGridView1.Rows) { s += item.Cells["单词"].FormattedValue + "\n";}MessageBox.Show(s);为什么不用for呢 因foreach快string s = "";for (int i = 0; i < dataGridVie...
阅读全文
摘要:treeView1.SelectedNode.Level获取 TreeView 控件中的树视图的深度(从零开始)。Level对于属性,根节点被视为第一级嵌套,并返回0。 //判断这个按钮可不可以使用toolStripButton1.Enabled = treeView1.SelectedNode != null && treeView1.SelectedNode.Level != 0;//我不愿意...
阅读全文
摘要:https://files-cdn.cnblogs.com/files/xe2011/ListBoxDemo202013181554.rar public partial class Form1 : Form { public Form1() { InitializeComponent(); } ListStri...
阅读全文