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