摘要:最新IP数据库 存储优化 查询性能优化 每秒解析上千万 qqzeng-ip-ultimate.dat 3.0版 阅读全文
随笔分类 - C#
微信 登录 Scope 参数错误或没有 Scope 权限
2017-07-04 12:16 by 曾祥展, 9442 阅读, 收藏, 编辑
摘要://电脑端 扫码授权登录 public static string AuthUrl = "https://open.weixin.qq.com/connect/qrconnect?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_l 阅读全文
最新一代文件结构 超高性能解析IP数据库 qqzeng-ip.dat
2015-07-31 08:13 by 曾祥展, 5065 阅读, 收藏, 编辑
摘要:最新一代文件结构 超高性能解析IP数据库 qqzeng-ip.dat 阅读全文
最新IP地址数据库 二分逼近&二分查找 高效解析800万大数据之区域分布
2014-05-26 22:15 by 曾祥展, 10469 阅读, 收藏, 编辑
摘要:最新IP地址数据库 来自 qqzeng.com 利用二分逼近法(bisection method) ,每秒500多万, 比较高效! 多语言API解析Dat 导入数据库脚本https://github.com/zengzhan/qqzeng-ip 原来的顺序查找算法 效率比较低 改进版 采用二分逼近 阅读全文
小米抢购(简单版v0.1)-登录并验证抢购权限,以及获取真实抢购地址
2013-10-22 13:11 by 曾祥展, 17491 阅读, 收藏, 编辑
摘要:小米(简单版)-登录并验证抢购权限,以及获取真实抢购地址! 并不是复制到浏览器就行了的 还得传递所需要的参数 这里只是前部分 后面的自己发挥了 说明:(抢购前1-2个钟才开放此链接,正式开始时才返回真实地址) console.log([]) json实体类: 抢购: //1.真实地址 返回 mi_d 阅读全文
FluentData-新型轻量级ORM 利用T4模板 批量生成多文件 实体和业务逻辑 代码
2013-08-10 15:11 by 曾祥展, 8452 阅读, 收藏, 编辑
摘要:FluentData,它是一个轻量级框架,关注性能和易用性。 下载地址:FlunenData.Model利用T4模板,【MultipleOutputHelper.ttinclude】批量生成多文件基本语法:1. 初始化:获取MultipleOutputHelper.ttinclude文件模板 在T4模板导入 //导入MultipleOutputHelper.ttinclude文件 路径 //初始化Manager对象 var manager = Manager.Create(Host, GenerationEnvironment); 2.文件块:使用代码标识区分生... 阅读全文
c# 异步更新UI 不阻塞
2012-08-23 12:51 by 曾祥展, 6310 阅读, 收藏, 编辑
摘要:c# 异步更新UI 不阻塞 流畅Task task = Task.Factory.StartNew(() =>{ DoLongRunningWork(); // 耗时运算});Task UITask= task.ContinueWith(() => { this.TextBlock1.Text = "Complete"; //运算后 赋值 }, TaskScheduler.FromCurrentSynchronizationContext());btnStop.Invoke(new Action(delegate() { this.btnStop.Enabled 阅读全文
高效率随机删除数据(不重复)
2011-10-30 21:46 by 曾祥展, 874 阅读, 收藏, 编辑
摘要:算法的复杂度就降低为 O(n) ,速度大大提高。需求:前后数据x条不动,中间随机删除N条记录实现: Dictionary<string, int> dictA = GetArrayListFromTxt(this.txtFileNameA.Text);Dictionary<string, int> dictB = GetArrayListFromTxt(this.txtFileNameB.Text);Dictionary<string, int> dictC= new Dictionary<string,int>();StringBuilder 阅读全文
快速从多个txt文本里面查找重复号码
2011-05-05 14:02 by 曾祥展, 817 阅读, 收藏, 编辑
摘要:批量快速查找重复号码小程序 界面如下: txt文本里面数据格式:一个号码一行 重点代码: /// <summary> /// 从文本文件中返回重复的字符串行 /// </summary> /// <param name="Path"></param> /// <returns></returns> 阅读全文
XmlToJSON(c#)
2010-03-06 10:20 by 曾祥展, 1628 阅读, 收藏, 编辑
摘要:usingSystem.Text;//StringBuilderusingSystem.Xml;//xmlusingSystem.Collections;//SortedListusingSystem.Web.UI;//ClientScriptManagerXmlDocumentdoc=newXmlDocument();stringsURL="http://rainmeter.accu-weath... 阅读全文
汉字转拼音
2010-02-09 20:24 by 曾祥展, 2085 阅读, 收藏, 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Text; using System.Text.RegularExpressions; namespace WebApplication1 { /// /// 汉字转拼音类 /... 阅读全文
C# 使用List泛型读取和保存文本文件
2010-01-30 11:14 by 曾祥展, 11213 阅读, 收藏, 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Management;//添加引用 using System.IO; namespace ConsoleApplication1 { class Program { ... 阅读全文
C#图片上传,加水印,自动生成缩略图
2009-12-31 08:20 by 曾祥展, 1562 阅读, 收藏, 编辑
摘要:using System; using System.Data; using System.Data.SqlClient; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using Syste... 阅读全文
c# 图片插入Excel
2009-11-24 10:45 by 曾祥展, 11033 阅读, 收藏, 编辑
摘要:引用COM:Microsoft Office 11.0 Object Library 引用类: using System; using System.Windows.Forms; using Excel = Microsoft.Office.Interop.Excel; 调用: private void button1_Click(objectsender, EventArgse) { Pict... 阅读全文
winform的关闭x按钮处于不可用
2009-11-03 14:50 by 曾祥展, 966 阅读, 收藏, 编辑
摘要:添加对using System.Runtime.InteropServices的引用 [ DllImport ( "USER32.DLL" ) ] public static extern int GetSystemMenu(int hwnd, int bRevert); [ DllImport ( "USER32.DLL" ) ] public static extern in... 阅读全文
c# 备份还原 例子
2009-09-23 09:59 by 曾祥展, 531 阅读, 收藏, 编辑
摘要://记得加folderBrowserDialog1openFileDialog1控件usingSystem.Data.SqlClient;//连接数据库公共变量namespaceWindowsApplication1.GoodMenhod{classgetSqlConnection{stringsql="DataSource=win7-pc;database=Kc;uid=sa;pwd=sa";S... 阅读全文