DataTable转换为List 【拓展方法】 public static class ReflectionHelper { public static List ToList(this DataTable dt) where T : class { Type type = typeof(T); List list = new List();
利用postmessage间接实现iframe跨域调用父页面js函数 父页面html代码: window.onload = function () { //添加监听事件。 if (typeof window.addEventListener != "undefined") window.addEventListener("messag
生成随机密码 /// /// 生成随机密码。 /// /// 密码长度。 /// 1-小写;2-大写;其他值-大小写混合; /// private string GeneratePassword(int length, int flag) { StringBuilder password = new StringBuilder();
XmlHttpReques function ajax(url, data, method, fn) { var request = new XMLHttpRequest(); request.open(method, url, true); request.setRequestHeader("Content-Type", "applica
CSS绘制气泡提示框 .tag { width: 100px; height: 22px; border: 1px solid Gainsboro; position: relative; background-color: #F9F5C7; font-size: 8px;
JQuery判断Capslock状态 html代码部分: #tip { position: absolute; height: 12px; padding: 5px; text-align: right; display: none; bo
获取硬盘容量 using System;using System.Collections.Generic;using System.Linq;using System.Management;using System.Text;namespace LCore{ /// /// 磁盘信息类。 /// public class LHarddiskInfo {
C#屏幕右下角弹窗 int tempUp; Timer timer_Start = new Timer(); private void timer_Start_Tick(object sender, EventArgs e) { tempUp += 20; if (this.Bottom <= Screen.Primar
重载操作符 class Program { static void Main(string[] args) { Money m1 = new Money() { RMB = 3 }; Money m2 = new Money() { RMB = 2 }; Console.WriteLine(m1 *
线程启动带多个参数的方法 在C#里,线程可以执行带一个类型为object的参数的方法。由此可将多个参数写成一个struct或者class。在传递参数时,将struct或者class传递给方法,在方法的内部再将object还原成struct或者class就搞定了!参考代码://1.参数结构。 public struct Parameter { public int Length { g
C#全局鼠标钩子 using System;using System.Diagnostics;using System.Runtime.InteropServices;namespace Hook{ /// /// 鼠标钩子类。 /// public class MouseHook : BaseHook { #region # 全局变量 #
C#全局键盘钩子 using System;using System.Collections.Generic;using System.Diagnostics;using System.Runtime.InteropServices;namespace Hook{ /// /// 键盘钩子类。 /// public class KeyBoardHook : BaseH
C#递归获取窗体上所有TextBox的文本 private void GetTextArray() { foreach (Control item in this.Controls) { if (item.HasChildren) GetText(item); } }
C#注释 转载自:孙景文 程序人生 对整体进行概要性描述Description类、属性(不推荐)、方法等 跟在Summary之后,对方法所涉及的入口参数进行有效的解释本参数是用户的帐号方法的入口参数; 对方法的返回值进行解释;返回值零代表操作成功,-1代表操作不成功方法的返回值; 对一些语句进行备注性描述