自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(3)
  • 资源 (14)
  • 收藏
  • 关注

原创 MYSQL性能测试

MYSQL插入 set global innodb_flush_log_at_trx_commit = 0; set autocommit = 0; drop procedure if exists test1; DELIMITER // create procedure test1(in sum int) begin delete from person; commit; s

2016-12-16 16:00:42 201

原创 MS SQL性能测试

MS SQL插入:SET IMPLICIT_TRANSACTIONS ONDECLARE @I INTEGER, @STARTTIME DATETIME, @ENDTIME DATETIME, @SUM INT DELETE FROM PERSON; COMMIT TRAN;SET @SUM = 100000 SET @STARTTIME = GETDATE(); SET @I = 0; WHILE

2016-12-11 16:40:50 335

原创 ORACLE性能测试

oracle性能测试: CREATE OR REPLACE PROCEDURE TEST ISI INTEGER; STARTTIME TIMESTAMP; ENDTIME TIMESTAMP;BEGIN DELETE FROM PERSON; COMMIT; STARTTIME := SYSTIMESTAMP; FOR I IN 1..100000 LOOP INSERT I

2016-12-11 13:30:29 1629

aop相关开发包

内容包括: aopalliance.jar aspectj-1.8.9.jar aspectjrt.jar aspectjweaver.jar org.springframework.aop.jar

2016-07-19

c# 自定义特性

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Entity; using System.Collections; using System.Diagnostics; using System.Reflection; namespace TestConsole { public class JWAttribute : Attribute { public string param1 { get; set; } public string param2 { get; set; } public string paramDefault = "paramDefault"; } [JW(param1 = "JW-A")] public class A { [JW(param2 = "JW-property")] public string property { get; set; } [JW(param2 = "JW-fun")] public void fun() {} public void nofun() {} } class Program { static void Main(string[] args) { JWAttribute jw; jw = typeof(A).GetCustomAttributes(typeof(JWAttribute), false).Single() as JWAttribute; Console.WriteLine(jw.param1); jw = typeof(A).GetProperty("property").GetCustomAttributes(typeof(JWAttribute), false).Single() as JWAttribute; Console.WriteLine(jw.param2); jw = typeof(A).GetMember("fun").Single().GetCustomAttributes(typeof(JWAttribute), false).Single() as JWAttribute; Console.WriteLine(jw.param2); Console.WriteLine(typeof(A).GetMember("nofun").Single().GetCustomAttributes(typeof(JWAttribute), false).Count()); Console.WriteLine(jw.paramDefault); AssemblyCopyrightAttribute aca = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false).Single() as AssemblyCopyrightAttribute; Console.WriteLine(aca.Copyright); Console.ReadKey(); } } }

2013-01-08

共享服务例程

使用SvcHost.exe共享服务。 0. 关闭360等软件 1. TestServiceGroup.reg 重启(svchost识别) 2. install.bat start.bat stop.bat uninstall.bat

2012-12-30

Excel大小写转换

Excel大小写转换 Sub Upper() Dim itarget As Range Set itarget = Selection For Each ran In itarget ran.Value = UCase(ran) Next End Sub Sub Lower() Dim itarget As Range Set itarget = Selection For Each ran In itarget ran.Value = LCase(ran) Next End Sub

2012-12-24

ProPowerTools.vsix

ProPowerTools.vsix vs2010 最新编辑插件... 好用

2012-12-17

简单对象序列化 扩展Object.ToJson

简单对象序列化 扩展Object.ToJson 有时候需要将对象内部的成员全部打印出来。就用这个扩展...

2012-12-15

json2.js 下载

使用xmlhttp, 或ajax与服务器间互传数据结构的时候,非常奏效。 找了好久...

2012-12-13

c#安全字典

直接使用Dictionary,在获取未定义的key的value时,会抛出异常。 SafeDictionary,将之安全封装。就像使用Session一样。

2012-12-08

c# object, dynamic, var的区别用例

// object, dynamic, var的区别用例 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { public string param = "param"; static void Main(string[] args) { object obj; obj = new Program(); dynamic dyn; dyn = new Program(); //var v; v = new Program(); // 错误写法。正确写法如下: var v = new Program(); // 定义的同时必须指明初始化类型。 // 等价于:Program v = new Program();编译器自动识别。 //string info1 = obj.param; // 错误写法。正确写法如下: string info1 = ((Program)obj).param; // 必须显示告诉编译器,object是什么类型。 string info2 = dyn.param + new Program() + 1; // 正确。但.param不能智能感知。 // 编译通过是因为与dynamic相关的所有类型操作,编译器全部放行。 // 很显然,运行时必然通过“自动反射”进行检查。 string info3 = v.param; Console.WriteLine(info1); Console.WriteLine(info2); Console.WriteLine(info3); Console.ReadKey(); } } }

2012-12-02

mvc3源代码 mvc3-rtm-sources.zip

有了这份源代码,就可以看到mvc3框架的内部实现。 给调试带来了很多方便...

2012-12-01

c#使用命名管道实现打印调试

命名管道的实际用例。 // 服务端 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Threading; using System.IO.Pipes; using System.IO; namespace CSharpTraceServer { public partial class CSharpTraceForm : Form { NamedPipeServerStream server; StreamReader reader; public CSharpTraceForm() { InitializeComponent(); } private void CSharpTraceForm_Load(object sender, EventArgs e) { // 命名管道 server = new NamedPipeServerStream("_"); // 后台线程 backgroundWorker.DoWork += new DoWorkEventHandler(backgroundWorker_DoWork); backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged); backgroundWorker.RunWorkerAsync(); // 窗口事件关联 this.SizeChanged += new EventHandler(CSharpTraceForm_SizeChanged); // 窗口配置 WindowState = FormWindowState.Maximized; } private void AdjustSize() { int X = 0; int Y = menuStrip1.Size.Height; int Width = Size.Width; int Height = Size.Height; textboxInformation.Location = new Point(X, Y); textboxInformation.Size = new Size(Width, Height); } void CSharpTraceForm_SizeChanged(object sender, EventArgs e) { AdjustSize(); } private void clearToolStripMenuItem_Click(object sender, EventArgs e) { textboxInformation.Text = ""; } void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { string strInformation; while (true) { if (!server.IsConnected) { server.Close(); server = new NamedPipeServerStream("CSharpTrace"); reader = new StreamReader(server); server.WaitForConnection(); } strInformation = reader.ReadLine(); backgroundWorker.ReportProgress(1, strInformation); } } void backgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e) { textboxInformation.Text += e.UserState + "\r\n"; } } } // 客户端 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Pipes; using System.Threading; using System.IO; namespace CSharpTraceDll { public class CSharpTraceDll { // 简易接口 public static void Debug(string strInformation) { Init(); WriteLine(strInformation); } // 初始化连接环境 public static void Init() { // 初始化命名管道 if (_client == null) { _client = new NamedPipeClientStream("_"); } // 启动线程 if (_thread == null) { _thread = new Thread(new ThreadStart(ThreadRun)); _thread.IsBackground = true; _thread.Start(); } } // 断开连接 public static void UnInit() { // 终止线程 if (_thread != null) { _thread.Abort(); _thread = null; } // 释放命名管道 if (_client != null) { _client.Close(); _client = null; } } // 发送数据 public static void WriteLine(string strInformation) { // 检查合法性 if (_client == null) return; if (_writer == null) return; try { // 检查连接状态 if (_client.IsConnected) { // 发送信息 string strLine = string.Format("[{0}]:{1}", System.DateTime.Now.ToString(), strInformation); _writer.WriteLine(strLine); } } catch (Exception e) { // 捕获连接异常 Console.WriteLine(e.Message); } } // 内部线程 private static void ThreadRun() { while (true) { // 确保连接状态 if (!_client.IsConnected) { _client.Close(); _client = new NamedPipeClientStream(".", "CSharpTrace"); _writer = new StreamWriter(_client); _client.Connect(); _writer.AutoFlush = true; } Thread.Sleep(1000); } } private static NamedPipeClientStream _client; private static StreamWriter _writer; private static Thread _thread; } }

2012-11-30

vs2010 c# 独立打印调试

每次使用Visual Studio C#的Debug.WriteLine调试。个人调试信息与系统调试信息混杂在一起,难以区分。 CSharpTraceServer,与CSharpTraceDll应此出现。 使用方法: 1.CSharpTraceServer。打开CSharpTraceServer.exe。 2.CSharpTraceDll。在个人项目中添加CSharpTraceDll.dll的引用。 3.使用如下接口开始调试: CSharpTraceDll.CSharpTraceDll.Debug("打印信息"); 使用例程: Test(Test.exe)

2012-11-30

c# 反射实例

//c# 反射实例 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Reflection; namespace ConsoleApplication1 { class Program { static void Main( string[] args ) { // 类型名,方法名,参数 string className = "ConsoleApplication1.A"; string methodName = "Fun"; string param = "param"; // 获取程序集 Assembly assembly = Assembly.GetExecutingAssembly(); // 取得类型,方法;定义参数 Type type = assembly.GetType(className); MethodInfo method = type.GetMethod(methodName); object[] parameters = new object[] { param }; // 创建实例;调用方法(传递参数,获取返回值) object instance = assembly.CreateInstance(type.ToString()); string rt = (string)method.Invoke(instance, parameters); // 打印输出 Console.WriteLine(rt); Console.ReadKey(); } } class A { public string Fun(string param) { return "A.Fun:" + param; } } }

2012-11-30

vs2010 c# 独立打印调试工具

每次使用Visual Studio C#的Debug.WriteLine调试。个人调试信息与系统调试信息混杂在一起,难以区分。 CSharpTraceServer,与CSharpTraceDll应此出现。 使用方法: 1.CSharpTraceServer。打开CSharpTraceServer.exe。 2.CSharpTraceDll。在个人项目中添加CSharpTraceDll.dll的引用。 3.使用如下接口开始调试: CSharpTraceDll.CSharpTraceDll.Debug("打印信息"); 使用例程: Test(Test.exe)

2012-11-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除