C#中两个日期时间之间的时间间隔
string a="2016-04-07 12:12:12"; DateTime time_a = DateTime.Parse(a); string b = "2016-03-06 13:13:13"; DateTime time_b = DateTime.Parse(b); TimeSpan t …… 阅读全文
string a="2016-04-07 12:12:12"; DateTime time_a = DateTime.Parse(a); string b = "2016-03-06 13:13:13"; DateTime time_b = DateTime.Parse(b); TimeSpan t …… 阅读全文
一下以判断程序TestManagement中charity_img文件是否存在为例第一种:绝对路径如下:File.Exists(@"C:\Users\XTJSXY\Desktop\Test\TestManagement\TestManagement\charity_img");第二种:相对路径如下:File.Exists(@"../../charity_img/");这里的../../ …… 阅读全文
private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { //IsNumber判断输入的是不是数字 //e.KeyChar != (char)Keys.Back 判断输入的是不是退格 if (!(Char.IsNumber(e.K …… 阅读全文
declare @seconds int;set @seconds=7264;select CONVERT(varchar(50),(@seconds /3600))+' h '+CONVERT(varchar(50),(@seconds%3600)/60)+' m '+CONVERT(varchar(50),(@seconds%3600)/3600)+' s'2h1m4s …… 阅读全文
说明:窗体B由窗体A打开,当在窗体B中执行完某操作后,关闭窗体B,同时执行窗体A中的方法,比如:调用窗体A中加载数据的方法,实现数据的即时刷新 //窗体A中执行打开窗体B的Refresh()方法 frmB frm = new frmB(); if (frm.ShowDialog() == DialogResult.OK) …… 阅读全文
//选择文件夹 FolderBrowserDialog dia = new FolderBrowserDialog(); if (dia.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string filePath = dia.S …… 阅读全文