自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(57)
  • 收藏
  • 关注

转载 Elasticsearch 实现自定义排序插件

插件入口:package ttd.ugc.plugin;import org.elasticsearch.plugins.Plugin;import org.elasticsearch.script.ScriptModule;/** * Created by jin_h on 2017/1/9. */public class NativeScriptPlugin extend...

2017-02-09 19:42:00 589

转载 64进制和10进制转换

class Program { static void Main(string[] args) { long val = 123456789; Console.WriteLine(Parse64Encode(val)); Console.WriteLine(Pa...

2015-05-13 18:56:00 836

转载 身份证验证并计算

public static class IdCardHelper { static readonly int[] Weight = new int[] { 7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2 }; static readonly char[] VCode = new c...

2015-05-13 18:53:00 145

转载 导入导出CSV

const string dataPath = @"D:\Users\jin_h\Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\";private static DataTable GetCsvData(string filePath, string fileName)...

2015-05-13 18:49:00 158

转载 Regex.Split

private static List<int> GetThemeIds(string themeList) { const string split = "!===!"; return Regex.Split(themeList, split, RegexOptions.IgnoreCase).Select(int....

2015-05-12 15:10:00 136

转载 LocalCache

public static class LocalCacheHelper { private const int TimeOut = 5; //5分钟过期 public static T GetCache<T>(string cacheKey) { var cache = Ge...

2015-05-11 13:49:00 127

转载 获取客户端IP

public static string GetWebClientIp() { string userIP = "未获取用户IP"; try { if (System.Web.HttpContext.Current == null ...

2014-08-25 20:09:00 86

转载 查找字符串出现的位置

protected void Page_Load(object sender, EventArgs e) { string str = "abcqqqqqabchahhabcaaabcssssdbsssabcaadcsssabc"; string key = "abc"; MatchCo...

2014-04-14 23:01:00 285

转载 最简单的实现倒计时

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=...

2014-04-10 14:15:00 173

转载 (转).net中导入excel文件显示进度条

在ASP.NET中经常会遇到Excel文件导入数据库的问题,遇到数据量比较大的时候,最好显示进度条。进度条设计是参考网上某牛人提供的代码,利用JS实现的,谢谢这个大牛了(忘记了当时记录下他的大名了,:()。具体思路:首先将后台服务器上 ProgressBar.htm 页面内容(其中有html和js代码)完全读取出来,并write到前台。然后在数据导入前,添加js调用,如下: js...

2013-04-18 16:42:00 180

转载 C# 实现 MemCache 监控管理工具

  网上一直想找一个C# 写的MemCache监控工具,无奈都是Php写的工具(memadmin 是一款不错的监控工具),于是自己花费一周时间实现了部分memadmin 的功能,然后加入了部分自己需要的部分功能,下面详细介绍一下,主要是通过  常用的命令  stats  显示服务器信息、统计数据等  stats reset  清空统计数据  stats   malloc显示内存分配数...

2013-02-01 16:06:00 116

转载 .net 使用JQuery 调用Ashx 后面直接写方法名,通过反射找到对应的方法

using System.Reflection;public class Industry_Manager : IHttpHandler{ HttpRequest gRequest = null; HttpContext gContext = null; HttpResponse gResponse = null; string fun...

2012-10-16 14:21:00 127

转载 汉字拼音转码

public class ChineseString { public static class ChineseSpell { /// summary> /// 汉字拼音首字母列表 本列表包含了20902个汉字,用于配合 GetChineseSpell 函数使用,本表收录的字符的...

2012-08-13 17:27:00 9998

转载 js 实现百度搜索中的高亮显示

highlight: function(value, term) {return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?!...

2012-08-13 17:22:00 229

转载 C# .Net动态调用webService

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Net;using System.IO;using System.Web.Services.Description;using System.CodeDom;usin...

2012-05-07 16:25:00 122

转载 .net 将图片文件转换成流输出到浏览器

aspx 页面<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://w...

2012-04-17 13:35:00 732

转载 .net 最简单文件上传支持跨服务器

客户端HTML页面代码<html><head> <meta http-equiv="content-type" content="text/html;charset=gb2312" /> <title>File Upload</title></head><body>...

2012-04-17 13:29:00 110

转载 JSONCookie 操作

需要使用jquery.jsoncookie.js jquery.cookie.jsvar COOKIE_NAME = "Bind_Prod_List";var product; product = $.JSONCookie(COOKIE_NAME);//判断是否存在function IsExistsInCookie...

2012-04-11 17:01:00 161

转载 在C#用HttpWebRequest中发送GET/HTTP/HTTPS请求

using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Net;using System.Text;using System.IO;using System.Security.Cryptography.X509Certific...

2012-04-01 18:03:00 99

转载 Ajax 实现长轮询(long-polling)

长轮询是现在最为常用的方式,和流方式的区别就是服务器端在接到请求后挂起,有更新时返回连接即断掉,然后客户端再发起新的连接<script language="javascript" type="text/javascript"> var updater = { poll: function() { $.ajax({ ur...

2012-02-16 16:28:00 193

转载 Windows Phone 7

 离Windows Phone 7正式发布已过去几个月了,但国内关于Windows Phone 7的中文书籍资料太少了,大多数是英文资料,一本真正的中文开发教程书都没有, 要啃英文资料对大部分的开发者来说太难了,而且很多的中文的文章教程又太杂乱。 机微网把网站多个月来转载的Windows Phone 7相关的教程文章分类整理了一下,供广大的开发者参阅。希望各位作者能允许机微网(www....

2012-02-02 13:00:00 712

转载 使用JQuery 实现类似购物商城的购物车

使用JQuery Clone 模板来实现商品信息的展示,展现形式可以通过修改模板中的td来确定每一行显示多少个商品信息商品信息使用JSON数据来模拟同一个产品点击多次,不会重复添加,而是在已有的基础上数量+1,商品数量也可以手动输入,当输入0时,该商品将自动从购物车删除(点击减号到小于1时,也会提示是否从购物车删除商品信息)每个产品的价格和总价都会根据添加和删除的操作来...

2011-12-06 18:20:00 485

转载 MongoDB +JSON+JQuery.Pagination+Linq 实现无刷新分页

MongoDB 下载:http://www.mongodb.org/本实例中MongoDB的C#驱动,支持linq:https://github.com/samus/mongodb-csharpMongoDB的基本配置可以参考:http://www.cnblogs.com/lipan/archive/2011/03/08/1966463.html本实例中使用的MongoDB ...

2011-12-05 16:03:00 78

转载 MongoDBHelper

View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using MongoDB;public class MongoDBHelper : IDisposable{ private Mongo _mongo; private IMongoD...

2011-12-05 15:49:00 70

转载 Mongo db 与mysql 语法比较

mongodb与mysql命令对比传统的关系数据库一般由数据库(database)、表(table)、记录(record)三个层次概念组成,MongoDB是由数据库(database)、集合(collection)、文档对象(document)三个层次组成。MongoDB对于关系型数据库里的表,但是集合中没有列、行和关系概念,这体现了模式自由的特点。MySQL...

2011-12-03 00:00:00 71

转载 将mongodb作为服务

将mongodb作为服务mongod.exe --logpath D:\mongodb\mongodb.log --logappend --dbpath D:\mongodb\data --directoryperdb --serviceName MongoDB --install删除服务mongod.exe --remove转载于:https://ww...

2011-12-02 23:02:00 64

转载 各种类型的JSON格式化

View Code using System;using System.Collections.Generic;using System.Text;using System.Data;using System.Reflection;using System.Collections;using System.Data.Common;public class ConvertJson{...

2011-12-01 15:55:00 74

转载 jquery.pagination +JSON 动态无刷新分页

aspx 页面:View Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="SqlPage.aspx.cs" Inherits="SqlPage" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http...

2011-12-01 15:51:00 78

转载 JQuery 抓取博客园首页RSS

JQuery 抓取博客园首页RSS直接将代码保存到文本文档,更改后缀名为html浏览 即可查看效果!View Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd...

2011-12-01 14:01:00 107

转载 使用HtmlAgilityPack XPath 表达式抓取博客园数据

使用HtmlAgilityPackXPath表达式来抓取博客园数据使用WebClient 下载数据,HtmlAgilityPackXPath表达式解析数据,并绑定到Repeater控件Web 前端代码View Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default...

2011-12-01 13:23:00 147

转载 巧妙使用JQuery Clone 添加多行数据,并更新到数据库

Web前端代码View Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="BatchAdd.aspx.cs" Inherits="BatchAdd" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "htt...

2011-12-01 13:06:00 89

转载 JavaScript Soap 方式调用WebService

//JavaScript 通过Soap 调用WebService function SendSMSByWebService(){ var data; var UserName="web服务用户名"; var PassWord="密码"; var strMobilePhone=document.getElementById("txtMobilePhone...

2011-12-01 11:37:00 235

转载 javascript中对Date类型的常用操作

/** * 日期时间脚本库方法列表: * (1)Date.isValiDate:日期合法性验证 * (2)Date.isValiTime:时间合法性验证 * (3)Date.isValiDateTime:日期和时间合法性验证 * (4)Date.prototype.isLeapYear:判断是否闰年 * (5)Date.prototype.format...

2011-11-23 15:40:00 74

转载 JS Open XML

//针对两种浏览器,分别获取xmlDocument对象 functionloadXML(xmlFile) { varxmlDoc; if(window.ActiveXObject){ xmlDoc=newActiveXObject("Microsoft.X...

2011-11-21 13:27:00 125

转载 VS2008 快捷键

Ctrl+W,W: 浏览器窗口 Ctrl+W,S: 解决方案管理器 Ctrl+W,C: 类视图 Ctrl+W,E: 错误列表 Ctrl+W,O: 输出视图 trl+W,P: 属性窗口 Ctrl+W,T: 任务列表 Ctrl+W,X: 工具箱 Ctrl+W,B: 书签窗口 Ctrl+W,U: 文档大纲 Ctrl+D,B: 断点窗口 Ctrl+D...

2011-11-15 14:29:00 129

转载 DataTable 转换JSON

private string DataTableToJson(DataTable dt) { StringBuilder jsonBuilder = new StringBuilder(); jsonBuilder.Append("{\""); jsonBuilder.Append(dt.Ta...

2011-11-15 13:44:00 57

转载 查询得到当前数据库的所有数据表名 和 视图

--查询表和视图select * from information_schema.tables--查询视图select * from information_schema.views--查询数据库所有表select * from sysobjects where xtype= 'U' and status> 0sp_t...

2011-10-27 14:54:00 821

转载 读取xml Rss 的两种方式

//原始操作Rss XmlDocument xml = new XmlDocument(); xml.Load("http://digi.tech.qq.com/mobile/manufacturer/rss_manufacturer.xml"); X...

2011-10-08 16:52:00 142

转载 js 日期字符串转换成日期类型,判断星期几

var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; var dateStr = "2008-08-08 08:08:08"; var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/"))); ...

2011-09-29 17:43:00 327

转载 DBHelper

/// <summary> /// 根据sql 返回受影响的行数(增删改) /// </summary> /// <param name="sql"></param> /// <returns></returns> p...

2011-09-28 13:56:00 68

空空如也

空空如也

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

TA关注的人

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