张银的博客


Eat to live, but do not live to eat.

导航

随笔分类 -  【01】.NET

摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->usingSystem;usingSystem.Collections.Generic;usingSystem.Text;usingSystem.IO;usingSystem.Net;usingSystem.Text.RegularExpressions;namespaceZxq.Common{//郑希强//www.cnblogs.com/zhengxiqiang//生成静态页操作//2009. 阅读全文

posted @ 2013-04-03 11:33 张银 阅读(728) 评论(0) 推荐(0) 编辑

摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Collections;using System.IO;using System.Runtime.InteropServices;public static string path输出 = Directory.GetCurrentDirectory() + 阅读全文

posted @ 2012-07-06 17:29 张银 阅读(569) 评论(0) 推荐(0) 编辑

摘要:using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using Microsoft.Win32;public partial class PrintSetDefault : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { if (ReadReg() == 1) { ... 阅读全文

posted @ 2012-04-28 14:03 张银 阅读(1240) 评论(0) 推荐(2) 编辑

摘要:using System;using System.Collections.Generic;using System.Text;namespace temp{ public class QuickSort { /// <summary> /// 排序 /// </summary> /// <param name="numbers">待排序数组</param> /// <param name="left">数组第一个元素索引Index</param> /// <param na. 阅读全文

posted @ 2012-04-08 23:50 张银 阅读(629) 评论(0) 推荐(0) 编辑

摘要:如果问C#程序员,四舍五入方法是怎么写的。很多人上来就会轻而易举的写上一个Math.Round()方法。但却不知,其中可悲的奥妙之处!试写出下列计算结果: Math.Round(0.5) Math.Round(1.5) 肯定有一部分人会写,计算结果为1和2。 那就大错特错了!事实证明,这两个表达式的结果分别为0和2!这就是很多程序的BUG所在。 细心的程序员们可以看一下MSDN中对Math.Round(Decimal)方法的描述,其中对于返回值的描述如下:返回值类型:System.Decimal最接近参数d的整数。如果d的小数部分正好处于两个整数中间,其中一个整数为偶数,另一个整... 阅读全文

posted @ 2012-03-30 15:02 张银 阅读(2579) 评论(1) 推荐(0) 编辑

摘要:电脑上安装了39条码字体:C39HrP24DlTt先看下控件界面截图转换条码字体 private void button1_Click(object sender, EventArgs e) { Bitmap b1 = new Bitmap(Convert.ToInt32(textBox2.Text), Convert.ToInt32 ( textBox3.Text)); Graphics g1 = Graphics.FromImage(b1); Font font1 = new Font("C39H... 阅读全文

posted @ 2012-03-30 12:58 张银 阅读(3511) 评论(1) 推荐(3) 编辑

摘要:.NET Reactor 是个好东西,只不过这家伙升级的速度非常快,加密算法经常变化,而且越来越厉害,实在懒得 "跟" 了。这类工具通常在 "壳" 上做了大量的工作,诸如什么 JIT Hook、native loader 之类的。而我通常只使用它的混淆功能,所以用另外一种方法 "绕" 过去,即便不注册,也可以使用最新版本。 首先,我们准备一个简单一点的 DLL,用于分析 .NET Reactor 混淆后的限制。test.dllnamespace MyLibrary{ public class MyClass { public void 阅读全文

posted @ 2012-01-15 22:00 张银 阅读(10388) 评论(2) 推荐(2) 编辑

摘要:SuppressIldasmAttribute 是最简单也是最常用的 "反反编译" 手段,它的作用就是"提醒" ildasm.exe 不要工作。但作为一个重要的反编译工具,我们当然不希望 ILDasm.exe 这么"聪明"。没办法,还是得自己动手,给ildasm.exe 当头一棒,打傻再说。 首先拿出 CFF Explorer 看看 ildasm.exe 的基本信息。 晕!居然是 Win32 Native Code,看来试图修改 IL 的老办法是没戏了。怎么办呢?既然是 native code,也就是说它没有办法用我们所熟悉的反射手段 阅读全文

posted @ 2012-01-15 05:16 张银 阅读(617) 评论(0) 推荐(0) 编辑

摘要:IL文件修改入门篇================================== Object: 掌握简单的IL文件处理知识 能够熟练运用ildasm,ilasm工具 ================================== 1.编写简单的hello.cs2.编译源代码csc hello.cs3.反编译hello.exe,命令如下: ildasm hello.exe /out=hello.il4.打开hello.il文件,找到下面语句 IL_0000: ldstr "Hello World!" 修改为 IL_0000: ldstr "Hello 阅读全文

posted @ 2012-01-15 04:01 张银 阅读(667) 评论(1) 推荐(1) 编辑

摘要:c# code:using System;public class aidd2008{ public static void Main(String[] argv) { int x = 10; int y = 6; if (x > y) { Console.WriteLine(x); } else { Console.WriteLine(y); } Console.Read(); } } MSIL code... 阅读全文

posted @ 2012-01-15 00:17 张银 阅读(578) 评论(0) 推荐(0) 编辑

摘要:一、IL与汇编语言 IL(Intermediate Language)是微软.NET平台上衍生出的一门中间语言,.NET平台上的各种高级语言(如C#,VB,F#)的编译器会将各自的代码转化为IL。,其中包含了.NET平台上的各种元素,如“范型”、“类”、“接口”、“模块”、“属性”等等。值得注意的是,各种高级语言本身可能根本没有这些“概念”在里头,如IronScheme是一个在.NET平台上的Scheme语言实现,其中根本没有前面提到的这些IL——亦或说是.NET平台上的名词。IL本身并不知道自己是由哪种高级语言转化而来的,哪种语言中有哪些特性,IL也根本不会关心。 各种语言的编译器将: .. 阅读全文

posted @ 2012-01-14 22:22 张银 阅读(2949) 评论(1) 推荐(1) 编辑

摘要:IPrincipal和IIdentity  通过查阅文档,我们可以看到HttpContext.User属性的类型是IPrincipal接口。然而我们知道,接口通常是不能直接访问的,其背后必定隐藏了一个实现了该接口的对象。那么这个实际对象的类型是什么呢?  让我们在前面示例的MasterPage的Page_Init方法上加一个断点,再次运行程序,可以得到HttpContext.User属性的真正类型... 阅读全文

posted @ 2009-07-04 21:13 张银 阅读(424) 评论(0) 推荐(0) 编辑

摘要:从这一部分开始,我们将通过一个实际的完整示例来看一下如何实现用户注册与登录。在介绍注册与登录之前,我们首先介绍一下如何判断用户是否已登录,并为后面的示例编写一些基础代码。判断用户是否已经登录 首先,在Web站点项目中添加一个MasterPage,例如MasterPage.master。在这个母版页的ContentPlaceHolder控件之前、<From>标签之内插入如下代码:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->< 阅读全文

posted @ 2009-07-04 13:56 张银 阅读(406) 评论(0) 推荐(0) 编辑

摘要:转自http://www.cnblogs.com/AndersLiu本文示例代码:http://www.codeplex.com/a/Release/ProjectReleases.aspx?ReleaseId=9518前言  本来使用Forms Authentication进行用户验证的方式是最常见的,但系统地阐明其方法的文章并不多见,网上更多的文章都是介绍其中某一部分的使用方法或实现原理,而更... 阅读全文

posted @ 2009-07-04 12:50 张银 阅读(340) 评论(0) 推荐(0) 编辑

摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1<%@PageLanguage="C#"AutoEventWireup="true"CodeFile="i05630229(2).aspx.cs"Inherits="i05630229_2_"%&... 阅读全文

posted @ 2009-06-16 23:41 张银 阅读(1097) 评论(0) 推荐(0) 编辑

摘要:[代码] 不设置优先级: 设置优先级: 阅读全文

posted @ 2009-06-06 00:31 张银 阅读(236) 评论(0) 推荐(0) 编辑

摘要:using System.Security.Cryptography; // //MD5加密函数 // public string MD5(String str) { MD5 md5=new MD5CryptoServiceProvider(); byte[] data=System.Text.Encoding.Default.GetBytes(str); byte[] re... 阅读全文

posted @ 2009-05-02 16:34 张银 阅读(367) 评论(0) 推荐(0) 编辑

摘要:第一部分: 互相介绍及了解 1.请介绍一下你自己?包括工作经历和项目经历? 2.请谈一下你就最近的一个项目?你在其中的职责和负责的部分? 第二部分: 一、ASP.NET技术问题选择性提问。一般可以选择三五个。 1. 简要说一下.Net的编译过程. 2.ASP.NET与ASP的区别 3.谈一下ASP.NET页面生命周期 4.ASP.NET程序的运行机制。可以从一个页面的请求到返回的角度谈 5.Jav... 阅读全文

posted @ 2009-03-10 17:40 张银 阅读(1057) 评论(0) 推荐(0) 编辑

摘要:RegisterStartupScript/Literal 阅读全文

posted @ 2009-02-18 09:31 张银 阅读(1440) 评论(0) 推荐(0) 编辑

摘要:大家还有什么代码能够实现代码点击按钮的效果?如果按钮是.NET动态类型()的,JS代码是不是通用的? 阅读全文

posted @ 2009-02-16 22:53 张银 阅读(2681) 评论(2) 推荐(0) 编辑