
基础
donghaima
这个作者很懒,什么都没留下…
展开
-
让我们反射吧
WinForm using System.CodeDom;using System.CodeDom.Compiler;using Microsoft.CSharp;using System.Reflection;using System.Windows.Forms; namespace WindowsFormsApplication1{ public class Class1原创 2008-09-02 10:06:00 · 320 阅读 · 0 评论 -
C#3.0 实战迭代器
......using System.Xml.Linq;using System.Collections; namespace YJXMLCombination{ struct STRUCT_TRANS_MAIN { public string trans_type; public string s_ent_name; publ原创 2008-11-20 15:48:00 · 332 阅读 · 0 评论 -
防止注入式攻击必须做到的
输入文本框限制长度,够用就行; 不要直接使用字符串构造SQL命令,应该用SQLDataSource等控件或着参数构造命令,它们会帮你过滤有威胁的字符; 用Session 而不是Request,尽量不要暴露网页参数。并且一定要检查传递的参数,比如ID可以转换数字再转换成String使用;原创 2009-01-14 10:45:00 · 362 阅读 · 0 评论 -
缓冲区溢出之JMP ESP皮毛
Windows下执行一个函数,会把指向正在运行的指令的地址压入堆栈,也就是寄存器EIP的值。当函数执行完毕,会让该数据出栈,以便程序继续原路运行。 如果这个函数有8个CHAR的局部变量,也压入堆栈。堆栈是从内存高地址向低地址分配的,如果这8个CHAR是放置用户输入的数据,并且如果没有检查长度的话,可能会覆盖掉高地址的记录EIP的值,如果这个值是一个非法地址,当函数返原创 2009-01-16 09:03:00 · 906 阅读 · 0 评论 -
几句PowerShell
列出当前目录的只读文件dir|where-object{$_.IsReadOnly} 列出目录是这样:dir|where-object{$_.PSIsContainer}如果想知道目录下有多少文件get-childitem|where-object{$_.PSIsContainer}|foreach-object{$_.name+": " + $_.getfiles().le原创 2009-01-14 10:46:00 · 954 阅读 · 0 评论 -
LINQ实战
简单合计int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };double numSum = numbers.Sum(); 合计数组中的字符数string[] words = { "cherry", "apple", "blueberry" };double totalChars = words.Sum(w => w.Length); 找原创 2008-12-05 12:59:00 · 1020 阅读 · 0 评论 -
更改打印机的两种方法
针对Printer的方法Dim i As IntegerFor i = 0 To Printers.Count - 1 MsgBox Printers .DeviceNameNext iSet Printer = Printers(2)MsgBox Printer.DeviceNamePrinter.Print "ILOVEYOU"Printer.EndDoc针对使用自动化服原创 2008-12-24 09:40:00 · 889 阅读 · 0 评论 -
2009-11-6一点杂乱的知识
打开Active Directory 用户和计算机为每一台机器配置策略(域名)xzl.local右键->新建组织单位,名称为C_XZL03在Computers选中XZL03右键->移动到->C_XZL03C_XZL03右键->属性->组策略-〉添加->全部->选中C_STOPU 推策略脚本,服务器会有自己的共享目录放置脚本给客户端读取,不需要人为开个共享目录域控刚起来,可能某原创 2009-11-06 14:50:00 · 393 阅读 · 0 评论 -
银行家四舍五入法
银行家四舍五入法规则:四舍六入五考虑;五后非零可进一;五后皆零视奇偶,五前为偶(包括零)应舍去,奇进偶舍。 for (decimal i = 0; i { decimal x = i+0.405M; //double不适用 //银行家四舍五入法 textBox1.Text+= (x + " Math.Round->" + Math.Round(x,原创 2009-12-11 09:47:00 · 2450 阅读 · 0 评论