随笔分类 -  c#

摘要://默认当年1月1号 ViewBag.time1 = new DateTime(DateTime.Now.Year, 1, 1).ToString("yyyy-MM-dd"); ViewBag.time2 = DateTime.Now.ToString("yyyy-MM-dd"); new Date 阅读全文
posted @ 2019-03-01 10:05 enych 阅读(4755) 评论(0) 推荐(0)
摘要:private void Form1_Load(object sender, EventArgs e) { decimal dd = (decimal)11234567890.01; string ddstr = dd.ToString(); test(ddstr); } ... 阅读全文
posted @ 2019-02-26 18:11 enych 阅读(383) 评论(0) 推荐(0)
摘要:[DllImport("user32.dll")] static extern IntPtr SetWindowsHookEx(int idHook, keyboardHookProc callback, IntPtr hInstance, uint threadId); /// /// 安装钩子 /// ... 阅读全文
posted @ 2019-01-29 17:07 enych 阅读(2407) 评论(0) 推荐(0)
摘要:/// /// 获得固定年月日,时和分不固定 : 2019-01-01 00:00:00 /// /// public DateTime GetFixedDateTime(string Hour = "", string Minute = "") { string time1 = Da... 阅读全文
posted @ 2019-01-28 11:22 enych 阅读(1492) 评论(0) 推荐(0)
摘要://计算比率 decimal A =(decimal) 200.20; decimal B = (decimal)1000.20; decimal t = decimal.Parse((A/B).ToString("0.000")) ; //保留3位小数 // ... 阅读全文
posted @ 2019-01-21 14:06 enych 阅读(16588) 评论(0) 推荐(0)
摘要:public class A//先定义A类 { } public static class Extension//必须先声明一个静态类,类名随意 { public static int ToInt32(this string In)//扩建的方法必须是静态方法,参数里面必须含有this关键字,this关键字后面的类型 { ... 阅读全文
posted @ 2019-01-10 10:40 enych 阅读(582) 评论(0) 推荐(0)
摘要:public void GetWMDay() { List list = new List(); string year = "2019"; DateTime counYear = Convert.ToDateTime(year + "-01-01"); // DateTime ne... 阅读全文
posted @ 2019-01-02 18:20 enych 阅读(1016) 评论(0) 推荐(0)
摘要:calendarset.do?start=1548518400&end=1552147200&_=1546421856958calendarset.do?start=1550937600&end=1554566400&_=1546421856959calendarset.do?start=15539 阅读全文
posted @ 2019-01-02 18:18 enych 阅读(5411) 评论(0) 推荐(0)
摘要:引用某大神回答 Array是数组,动态的 int[]也是数组,但是是静态的。。 http://www.runoob.com/csharp/csharp-array-class.html Array 类是 C# 中所有数组的基类,它是在 System 命名空间中定义。Array 类提供了各种用于数组的 阅读全文
posted @ 2019-01-02 11:40 enych 阅读(2948) 评论(0) 推荐(0)
摘要:private Bitmap Out1DImg() { // 1.设置条形码规格 EncodingOptions encodeOption = new EncodingOptions(); encodeOption.Height = 68; // 必须制定高度、宽度 enco... 阅读全文
posted @ 2018-12-25 08:22 enych 阅读(6133) 评论(0) 推荐(0)
摘要:this.printDocument1.PrinterSettings.PrinterName = "Microsoft XPS Document Writer"; this.printDocument1.Print(); //直接打印开始打印 (调用的是默认打印机)(系统会自动默认一个打印机) 阅读全文
posted @ 2018-12-24 22:42 enych 阅读(5166) 评论(0) 推荐(0)
摘要:this.ActiveControl = txt_core; 阅读全文
posted @ 2018-12-22 16:04 enych 阅读(1991) 评论(0) 推荐(0)
摘要:string PrintName = cmbPrinter.SelectedIndex.ToString(); PrintName = cmbPrinter.SelectedItem.ToString(); // if (cmbPrinter.SelectedIndex != 0) { ... 阅读全文
posted @ 2018-12-22 11:52 enych 阅读(15076) 评论(4) 推荐(1)
摘要:第一种 (全屏不可触发) protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, System.Windows.Forms.Keys keyData) { int WM_KEYDOWN = 256; in 阅读全文
posted @ 2018-12-21 15:01 enych 阅读(636) 评论(0) 推荐(0)
摘要:private void button2_Click(object sender, EventArgs e) { Process[] ProceddingCon = Process.GetProcesses(); //获得所有进程 IntPtr intPtr = IntPtr.Zero; foreach (... 阅读全文
posted @ 2018-12-21 12:27 enych 阅读(969) 评论(0) 推荐(0)
摘要:通过遍历ht 返回一个数组 阅读全文
posted @ 2018-12-19 16:27 enych 阅读(5853) 评论(0) 推荐(1)
摘要:var temp = System.DateTime.Today.ToString("dddd", new System.Globalization.CultureInfo("zh-CN")); 阅读全文
posted @ 2018-12-18 10:03 enych 阅读(537) 评论(0) 推荐(0)
摘要://去掉标题栏 1. this.FormBorderStyle = FormBorderStyle.None; // 不会显示窗体标题栏等相关 //最大化 2. this.WindowState = FormWindowState.Maximized; //窗体最大化时 非全屏 不会遮盖任务栏 设置 阅读全文
posted @ 2018-12-04 09:55 enych 阅读(4383) 评论(0) 推荐(0)
摘要:Access_Registry(key, "Adobe\\Acrobat Distiller\\DC"); //Adobe是自己要对某个程序注册表主目录 //HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Distiller\DC //RunFromLocalDi 阅读全文
posted @ 2018-12-03 13:36 enych 阅读(495) 评论(0) 推荐(0)
摘要:var t0est = Convert.ToString(""+null);//结果"" var t1est = ("" + null).ToString(); //结果"" var t2est = null.ToString(); //语法错误 阅读全文
posted @ 2018-11-28 14:43 enych 阅读(145) 评论(0) 推荐(0)