随笔分类 -  C#每天一例

持续行动,相信坚持的力量。
摘要:2020-04-05 每日一例第27天 1.打开记事本,输入html格式语言; 2.后台代码注释; <html> <head><!--标题语句--> <tittle> X的家</tittle><!--标题--> </head> <body><!--内容--> 窗前明月光,疑是地上霜。 </body> 阅读全文
posted @ 2020-04-05 23:32 winnerljs 阅读(272) 评论(0) 推荐(0)
摘要:2020-04-04 每日一例第26天 1.新建对话框; 2.后台代码; StartPosition = FormStartPosition.CenterScreen; 阅读全文
posted @ 2020-04-04 23:38 winnerljs 阅读(1306) 评论(0) 推荐(0)
摘要:2020-04-03 每日一例第26天 1.新建对话框,拖label/button控件; 2.后台代码; MessageBox.Show("10天前是:"+DateTime.Now.AddDays(-10).ToString("yyyy年M月d日"),"提示!"); 阅读全文
posted @ 2020-04-03 23:40 winnerljs 阅读(969) 评论(0) 推荐(0)
摘要:2020-04-02 每日一例第25天 1.新建对话框,拖label/textbox/button控件; 2.后台代码; int str; if (int.TryParse(text1.Text,out str)) { text2.Text = new Upper().NumToChinese(te 阅读全文
posted @ 2020-04-03 00:03 winnerljs 阅读(1794) 评论(0) 推荐(0)
摘要:2020-04-02 每日一例第24天 1.新建对话框,拖label/textbox/button控件; 2.后台代码; textBox1.Text = textBox1.Text.Replace(textBox2.Text, textBox3.Text); 阅读全文
posted @ 2020-04-02 00:24 winnerljs 阅读(2546) 评论(0) 推荐(0)
摘要:2020-03-31 每日一例第23天 1.新建对话框,拖label/textbox控件; 2.后台代码; private void textBox1_TextChanged(object sender, EventArgs e) { //输入字符转数组 char[] p_char = text1. 阅读全文
posted @ 2020-03-31 22:56 winnerljs 阅读(445) 评论(0) 推荐(0)
摘要:2020-03-30 每日一例第22天 1.新建对话框,拖label/textbox/button控件; 2.后台代码; //声明字段 StringBuilder sb = new StringBuilder(text1.Text); //遍历 for (int i = 0; i < sb.Leng 阅读全文
posted @ 2020-03-30 23:27 winnerljs 阅读(3186) 评论(0) 推荐(0)
摘要:2020-03-30 每日一例第21天 1.新建对话框,拖label/textbox控件; 2.后台代码; public string GetABC(string str) { Regex reg = new Regex("^[\u4e00-\u9fa5]$"); byte[] arr = new 阅读全文
posted @ 2020-03-30 00:06 winnerljs 阅读(675) 评论(2) 推荐(0)
摘要:2020-03-28 每日一例第20天 string fileName = @"D:\music\1.mp3"; //文件是否存在if (File.Exists(fileName)){ //删除文件File.Delete(fileName);} 阅读全文
posted @ 2020-03-28 23:24 winnerljs 阅读(5237) 评论(0) 推荐(0)
摘要:2020-03-28 每日一例第19天 string fileName = @"D:\music\1.mp3"; //文件是否存在 if (File.Exists(fileName)) { Console.WriteLine("{0}文件存在", fileName); Console.ReadKey 阅读全文
posted @ 2020-03-28 01:43 winnerljs 阅读(3799) 评论(0) 推荐(0)
摘要:2020-03-26 每日一例第18天 1)使用"+"拼接string字符串 string str = string.Empty; str = "a"; str = str + "b"; str = str + "c"; str = str + "d"; str = str + "e"; Conso 阅读全文
posted @ 2020-03-26 22:00 winnerljs 阅读(4466) 评论(0) 推荐(0)
摘要:2020-03-26 每日一例第17天 string str = "abcdefg"; string str1 = str.Replace("a","0"); Console.WriteLine(str1); Console.ReadKey(); 阅读全文
posted @ 2020-03-26 00:11 winnerljs 阅读(421) 评论(0) 推荐(0)
摘要:2020-03-25 每日一例第16天 1.新建对话框,拖timer1/dateTimePicker1; 2.代码; a.窗体加载时代码: timer1.Interval = 1000; dateTimePicker1.Value = DateTime.Parse("2015-01-01 00:00 阅读全文
posted @ 2020-03-25 00:32 winnerljs 阅读(1193) 评论(0) 推荐(0)
摘要:2020-03-23 每日一例第15天 1.新建对话框,拖Textbox/label/button; 2.“选择字体”按钮代码; FontDialog ff = new FontDialog(); if (ff.ShowDialog()==DialogResult.OK) { text4.Text 阅读全文
posted @ 2020-03-23 23:37 winnerljs 阅读(1734) 评论(0) 推荐(0)
摘要:2020-03-23 每日一例第14天 1.新建对话框,拖Textbox/label/button; 2.“保存文件”按钮后的代码; SaveFileDialog sf1 = new SaveFileDialog(); //设置对话框标题 sf1.Title = "保存导出文件"; //设置默认文件 阅读全文
posted @ 2020-03-23 00:23 winnerljs 阅读(9484) 评论(0) 推荐(1)
摘要:2020-03-22 每日一例第13天 1.新建对话框,拖Textbox/label/button; 2.“选择文件”按钮后的代码; OpenFileDialog op1 = new OpenFileDialog(); op1.Title = "选择数据文件"; op1.Filter = "所有文件 阅读全文
posted @ 2020-03-22 00:11 winnerljs 阅读(332) 评论(0) 推荐(1)
摘要:2020-03-21 每日一例第12天 1.常用属性 Name:名称; BackColor:设置控件背景颜色; BorderStyle:文本框样式; ContextMenuStrip:绑定右键弹出菜单; Dock:在父容器中的停靠方式; Enabled:是否可用; ForeColor:文字颜色; L 阅读全文
posted @ 2020-03-21 00:26 winnerljs 阅读(2975) 评论(0) 推荐(0)
摘要:2020-03-19 每日一例第11天 1.常用属性 Name:名称; BackColor:设置控件背景颜色; Enabled:是否可用; FlayStyle:控件样式; Image:设置控件图像; ImageAlign:图像对齐方式; ImageList:图像ImageList索引值; Locat 阅读全文
posted @ 2020-03-20 00:15 winnerljs 阅读(2870) 评论(0) 推荐(0)
摘要:2020-03-18 每日一例第10天 1.常用属性 Name:名称; Text:标题; Font:字体; Windowstate:状态;默认/最大化/最小化 Opacity:透明度; Maximizebox:最大化; Minimizebox:最小化; Ismidcontainer:该窗体是否MDI 阅读全文
posted @ 2020-03-19 00:16 winnerljs 阅读(3393) 评论(0) 推荐(0)
摘要:2020-03-17 每日一例第9天 1.新建窗体应用程序:窗体1,拖入label/textbox/button控件,并改text值; 2.新建窗体应用程序:窗体2,拖入label控件,并改text值; 3.新建一个类,类中创建一个静态字段; 类中代码: public class username 阅读全文
posted @ 2020-03-18 00:25 winnerljs 阅读(3379) 评论(0) 推荐(0)