随笔分类 - C#
摘要:usingSystem;usingSystem.Diagnostics;usingSystem.Reflection;namespaceMyTest{publicclassTestM{publicvoidTest(){StackFramefr=newStackFrame(1,true);MethodBasemb=fr.GetMethod();Console.WriteLine(mb.Name);Console.WriteLine(mb.DeclaringType.Assembly.GetName());}}} 另外,也可以使用 System.Reflection.Assembly.GetCal
阅读全文
摘要:typeof: The typeof operator is used to obtain the System.Type object for a type. 运算符,获得某一类型的 System.Type 对象。 Type t = typeof(int); GetType: Gets the Type of the current instance. 方法,获取当前实例的类型。 int i ...
阅读全文
摘要:c#读写xml文件已知有一个XML文件(bookstore.xml)如下:[代码]1、往<bookstore>节点中插入一个<book>节点: [代码]结果为:[代码]2、修改节点:将genre属性值为“李赞红“的节点的genre值改为“update李赞红”,将该节点的子节点<author>的文本修改为“...
阅读全文
摘要:1..net中捕获摄像头视频的方式及对比** 2.用Directshow.net的播放控件http://www.360doc.com/content/09/0307/16/50415_2739439.shtml 3。DirectShow.Net下载http://sourceforge.net/projects/directshownet/ 4。DirectShow .Net 实现视频预览(重点源码...
阅读全文
摘要:文章源地址: http://www.cnblogs.com/zengqs/archive/2009/02/01/1382024.html
阅读全文
摘要:引言 本篇文章主要介绍.NET中6个重要的概念:栈,堆,值类型,引用类型,装箱,拆箱。文章开始介绍当你声明一个变量时,编译器内部发生了什么,然后介绍两个重要的概念:栈和堆;最后介绍值类型和引用类型,并说明一些有关它们的重要原理。 最后通过一个简单的示例代码说明装箱拆箱带来的性能损耗。声明变量的内部机制 在.NET程序中,当你声明一个变量,将在内存中分配一块内存。这块内存分为三部分:1,变量名...
阅读全文
摘要:using System;using System.Data;using MySql.Data;using MySql.Data.MySqlClient;namespace DBUtility{ /// <summary> /// 基于MySQL的数据层基类 /// </summary> public abstract class MySqlHelper { #region...
阅读全文
摘要:用C#创建Windows服务(Windows Services)Windows服务在Visual Studio 以前的版本中叫NT服务,在VS.net启用了新的名称。用Visual C# 创建Windows服务不是一件困难的事,本文就将指导你一步一步创建一个Windows服务并使用它。这个服务在启动和停止时,向一个文本文件中写入一些文字信息。第一步:创建服务框架 要创建一个新的 Windows 服...
阅读全文
摘要:调试->异常->Managed Debuggin Assistants->LoaderLock 的选中状态去掉即可!如果异常(exception)这一项没有的话,在工具---自定义---命令选项卡---左边选择调试--右边把异常托到菜单里就可以了~异常也有个快捷键Ctrl+Alt+E.
阅读全文
摘要:C# GUID format 参数可以包含以下格式说明符。在下表中,返回值中的所有数字位均为十六进制。每个“x”字符表示一个十六进制位,每个连字符(“-”)、大括号(“{”、“}”)和圆括号(“(”、“)”)如表中所示。说明符 返回值的格式 N 32 位:...
阅读全文
摘要:[代码][代码][代码]加码解码的规则如下: 加码时将字符串中的所有字符转换成其对应的ASCII值的16进制值,例如:“A”的ASCII码值为65,以16进制值表示为41,故应发送两个字符“41”以代表字符“A”。 对于汉字则以其内码的16进制值来表示,如“测试”应为:B2E2CAD4。 [代码]以上内...
阅读全文
摘要:C#中的DLL注入事实上dll注入很简单,无非就是调用virtualAllocEx,WriteProcessMemory,OpenProcess,CreateRemoteThread等API函数,因为我是学c#的,所以也想看一下c#这方面的文章,但在网上找了半天,没有找到一篇,也许是c#刚兴起的缘故,学c#的并不多,没办法,只好自己移植一下,因为凡是用到API函数,所有的编程的语言都是相同的,这就...
阅读全文
摘要:1、合并file1.dll、file2.dll到destination.dll ILmerge /ndebug /target:dll /out:C:\destination.dll /log C:\file1.dll C:\file2.dll 2、合并file1.dll、file2.dll以及myApp.exe到newApp.exe ILmerge /ndebug /targ...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Run...
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Local...
阅读全文