摘要: class Program { static void Main(string[] args) { long val = 123456789; Console.WriteLine(Parse64Encode(val)); ... 阅读全文
posted @ 2015-05-13 18:56 晓风拂月 阅读(6524) 评论(1) 推荐(0) 编辑
摘要: 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 }; ... 阅读全文
posted @ 2015-05-13 18:53 晓风拂月 阅读(382) 评论(0) 推荐(0) 编辑
摘要: const string dataPath = @"D:\Users\jin_h\Documents\Visual Studio 2013\Projects\ConsoleApplication1\ConsoleApplication1\";private static DataTable GetC... 阅读全文
posted @ 2015-05-13 18:49 晓风拂月 阅读(538) 评论(0) 推荐(0) 编辑
摘要: private static List GetThemeIds(string themeList) { const string split = "!===!"; return Regex.Split(themeList, split, Re... 阅读全文
posted @ 2015-05-12 15:10 晓风拂月 阅读(732) 评论(0) 推荐(0) 编辑
摘要: public static class LocalCacheHelper { private const int TimeOut = 5; //5分钟过期 public static T GetCache(string cacheKey) { ... 阅读全文
posted @ 2015-05-11 13:49 晓风拂月 阅读(932) 评论(0) 推荐(0) 编辑
摘要: public static string GetWebClientIp() { string userIP = "未获取用户IP"; try { if (System.Web.HttpCo... 阅读全文
posted @ 2014-08-25 20:09 晓风拂月 阅读(393) 评论(1) 推荐(0) 编辑
摘要: protected void Page_Load(object sender, EventArgs e) { string str = "abcqqqqqabchahhabcaaabcssssdbsssabcaadcsssabc"; str... 阅读全文
posted @ 2014-04-14 23:01 晓风拂月 阅读(2065) 评论(0) 推荐(0) 编辑
摘要: 倒计时 阅读全文
posted @ 2014-04-10 14:15 晓风拂月 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 在ASP.NET中经常会遇到Excel文件导入数据库的问题,遇到数据量比较大的时候,最好显示进度条。进度条设计是参考网上某牛人提供的代码,利用JS实现的,谢谢这个大牛了(忘记了当时记录下他的大名了,:()。具体思路:首先将后台服务器上 ProgressBar.htm 页面内容(其中有html和js代码)完全读取出来,并write到前台。然后在数据导入前,添加js调用,如下: jsBlock = "<script>BeginTrans('开始处理...');</script>"; Response.Write(jsBlock); Res 阅读全文
posted @ 2013-04-18 16:42 晓风拂月 阅读(833) 评论(0) 推荐(0) 编辑
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2013-04-12 14:04 晓风拂月 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 网上一直想找一个C# 写的MemCache监控工具,无奈都是Php写的工具(memadmin 是一款不错的监控工具),于是自己花费一周时间实现了部分memadmin 的功能,然后加入了部分自己需要的部分功能,下面详细介绍一下,主要是通过 常用的命令 stats 显示服务器信息、统计数据等 stats reset 清空统计数据 stats malloc显示内存分配数据stats cachedump slab_id limit_num显示某个slab中的前limit_num个key列表,显示格式如下ITEM key_name [ value_length b; expire_t... 阅读全文
posted @ 2013-02-01 16:06 晓风拂月 阅读(11517) 评论(109) 推荐(14) 编辑
摘要: using System.Reflection;public class Industry_Manager : IHttpHandler{ HttpRequest gRequest = null; HttpContext gContext = null; HttpResponse gResponse = null; string func = string.Empty; string result = string.Empty; string pageUrl = string.Empty; public void ProcessRequest(Http... 阅读全文
posted @ 2012-10-16 14:21 晓风拂月 阅读(1995) 评论(2) 推荐(1) 编辑
摘要: public class ChineseString { public static class ChineseSpell { /// summary> /// 汉字拼音首字母列表 本列表包含了20902个汉字,用于配合 GetChineseSpell 函数使用,本表收录的字符的Unicode编码范围为19968至40869 /// /summary> private static string strChineseFirstPY = "YDYQS... 阅读全文
posted @ 2012-08-13 17:27 晓风拂月 阅读(561) 评论(0) 推荐(0) 编辑
摘要: highlight: function(value, term) {return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong style='color:red'> 阅读全文
posted @ 2012-08-13 17:22 晓风拂月 阅读(697) 评论(1) 推荐(0) 编辑
摘要: 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;using Microsoft.CSharp;using System.CodeDom.Compiler;using System.Reflection;namespace HTTPS{ public class WSHelper { ... 阅读全文
posted @ 2012-05-07 16:25 晓风拂月 阅读(14788) 评论(1) 推荐(1) 编辑
摘要: aspx 页面<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">< 阅读全文
posted @ 2012-04-17 13:35 晓风拂月 阅读(2951) 评论(0) 推荐(1) 编辑
摘要: 客户端HTML页面代码<html><head> <meta http-equiv="content-type" content="text/html;charset=gb2312" /> <title>File Upload</title></head><body> <form action="http://192.168.6.32:82/fileupload.aspx" method="post" id="uplo 阅读全文
posted @ 2012-04-17 13:29 晓风拂月 阅读(603) 评论(0) 推荐(0) 编辑
摘要: 需要使用jquery.jsoncookie.js jquery.cookie.jsvar COOKIE_NAME = "Bind_Prod_List";var product; product = $.JSONCookie(COOKIE_NAME);//判断是否存在function IsExistsInCookie(userName) { var flag = false; for (var i = 0; i < product.Product.length; i++) { var p = product.Product[i]; if (p.UserNa... 阅读全文
posted @ 2012-04-11 17:01 晓风拂月 阅读(3964) 评论(4) 推荐(0) 编辑
摘要: 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.X509Certificates;using System.Net.Security;namespace SD2.StockShare{ public class HttpWebResponseUtility { private stati... 阅读全文
posted @ 2012-04-01 18:03 晓风拂月 阅读(548) 评论(0) 推荐(0) 编辑
摘要: 长轮询是现在最为常用的方式,和流方式的区别就是服务器端在接到请求后挂起,有更新时返回连接即断掉,然后客户端再发起新的连接<script language="javascript" type="text/javascript"> var updater = { poll: function() { $.ajax({ url: "Handler1.ashx", type: "POST", dataType: "text", success: updater.onSuc... 阅读全文
posted @ 2012-02-16 16:28 晓风拂月 阅读(1822) 评论(0) 推荐(1) 编辑
摘要: 离Windows Phone 7正式发布已过去几个月了,但国内关于Windows Phone 7的中文书籍资料太少了,大多数是英文资料,一本真正的中文开发教程书都没有, 要啃英文资料对大部分的开发者来说太难了,而且很多的中文的文章教程又太杂乱。 机微网把网站多个月来转载的Windows Phone 7相关的教程文章分类整理了一下,供广大的开发者参阅。希望各位作者能允许机微网(www.gwewe.com)转载,如有任何版权问题请联系我们。希望大家都加入到Windows Phone开发者大军中来。就像张崟说的新机会不容错过。目录1(排名不分先后)1《Windows Phone 7 开发 31 日. 阅读全文
posted @ 2012-02-02 13:00 晓风拂月 阅读(380) 评论(0) 推荐(1) 编辑
摘要: 使用JQuery Clone 模板来实现商品信息的展示,展现形式可以通过修改模板中的td来确定每一行显示多少个商品信息商品信息使用JSON数据来模拟同一个产品点击多次,不会重复添加,而是在已有的基础上数量+1,商品数量也可以手动输入,当输入0时,该商品将自动从购物车删除(点击减号到小于1时,也会提示是否从购物车删除商品信息)每个产品的价格和总价都会根据添加和删除的操作来动态计算附下载链接:http://files.cnblogs.com/xffy1028/JQuery%E8%B4%AD%E7%89%A9%E8%BD%A61.rar基本的功能都已经实现,建议使用IE6,7,8,浏览器运行,其他浏 阅读全文
posted @ 2011-12-06 18:20 晓风拂月 阅读(4545) 评论(17) 推荐(5) 编辑
摘要: 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 版本是:mongodb-win32-i386-2.0.2-rc1.zipsamus 驱动版本:samus-mongodb-csharp-0.90.0.1-93-g6397a0f.zipweb前端:http://s.clic 阅读全文
posted @ 2011-12-05 16:03 晓风拂月 阅读(3525) 评论(5) 推荐(4) 编辑
摘要: View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using MongoDB;public class MongoDBHelper : IDisposable{ private Mongo _mongo; private IMongoDatabase _db; private static readonly string connString = "Server=127.0.0.1";//默认的数据库链接 private static r.. 阅读全文
posted @ 2011-12-05 15:49 晓风拂月 阅读(1053) 评论(0) 推荐(0) 编辑
摘要: mongodb与mysql命令对比传统的关系数据库一般由数据库(database)、表(table)、记录(record)三个层次概念组成,MongoDB是由数据库(database)、集合(collection)、文档对象(document)三个层次组成。MongoDB对于关系型数据库里的表,但是集合中没有列、行和关系概念,这体现了模式自由的特点。MySQLMongoDB说明mysqldmongod服务器守护进程mysqlmongo客户端工具mysqldumpmongodump逻辑备份工具mysqlmongorestore逻辑恢复工具db.repairDatabase()修复数据库mysql 阅读全文
posted @ 2011-12-03 00:00 晓风拂月 阅读(10363) 评论(3) 推荐(6) 编辑
摘要: 将mongodb作为服务mongod.exe --logpath D:\mongodb\mongodb.log --logappend --dbpath D:\mongodb\data --directoryperdb --serviceName MongoDB --install删除服务mongod.exe --remove 阅读全文
posted @ 2011-12-02 23:02 晓风拂月 阅读(356) 评论(0) 推荐(1) 编辑
摘要: 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{ #region 私有方法 /// <summary> /// 过滤特殊字符 /// </summary> private static string String2Json(String... 阅读全文
posted @ 2011-12-01 15:55 晓风拂月 阅读(8918) 评论(5) 推荐(3) 编辑
摘要: 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://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" 阅读全文
posted @ 2011-12-01 15:51 晓风拂月 阅读(9918) 评论(15) 推荐(2) 编辑
摘要: 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"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv=&q 阅读全文
posted @ 2011-12-01 14:01 晓风拂月 阅读(1027) 评论(4) 推荐(0) 编辑
摘要: 使用HtmlAgilityPackXPath表达式来抓取博客园数据使用WebClient 下载数据,HtmlAgilityPackXPath表达式解析数据,并绑定到Repeater控件Web 前端代码View Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 阅读全文
posted @ 2011-12-01 13:23 晓风拂月 阅读(6484) 评论(3) 推荐(5) 编辑
摘要: Web前端代码View Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="BatchAdd.aspx.cs" Inherits="BatchAdd" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quo 阅读全文
posted @ 2011-12-01 13:06 晓风拂月 阅读(7581) 评论(4) 推荐(4) 编辑
摘要: //JavaScript 通过Soap 调用WebService function SendSMSByWebService(){ var data; var UserName="web服务用户名"; var PassWord="密码"; var strMobilePhone=document.getElementById("txtMobilePhone").value; var strUserName=document.getElementById("txtUserName").value; var UserPwd 阅读全文
posted @ 2011-12-01 11:37 晓风拂月 阅读(2035) 评论(0) 推荐(1) 编辑
摘要: /** * 日期时间脚本库方法列表: * (1)Date.isValiDate:日期合法性验证 * (2)Date.isValiTime:时间合法性验证 * (3)Date.isValiDateTime:日期和时间合法性验证 * (4)Date.prototype.isLeapYear:判断是否闰年 * (5)Date.prototype.format:日期格式化 * (6)Date.stringToDate:字符串转成日期类型 * (7)Date.daysBetween:计算两个日期的天数差 * (8)Date.prototype.dateAdd:日期计算,支持正负数 * (9)Date.. 阅读全文
posted @ 2011-11-23 15:40 晓风拂月 阅读(1524) 评论(0) 推荐(0) 编辑
摘要: //针对两种浏览器,分别获取xmlDocument对象 functionloadXML(xmlFile) { varxmlDoc; if(window.ActiveXObject){ xmlDoc=newActiveXObject("Microsoft.XMLDOM"); xmlDoc.async=false; xmlDoc.load(xmlFile); } elseif(document.implementation&&document.implementation.createDocument){ xmlDoc=document.implementati 阅读全文
posted @ 2011-11-21 13:27 晓风拂月 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 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,I: 即时窗口 Ctrl+Tab: 活动窗体切换 Ctrl+Shift+N: 新建项目 Ctrl+Shift+O: 打开项目 Ctrl+Shift+S: 全部保存 Shift+Alt+C: 新建类 Ctrl+Shift+A: 新建项 Shift+Alt+ 阅读全文
posted @ 2011-11-15 14:29 晓风拂月 阅读(123) 评论(0) 推荐(0) 编辑
摘要: private string DataTableToJson(DataTable dt) { StringBuilder jsonBuilder = new StringBuilder(); jsonBuilder.Append("{\""); jsonBuilder.Append(dt.TableName); jsonBuilder.Append("\":["); for (int i = 0; i < dt.Rows.Count; i++) { ... 阅读全文
posted @ 2011-11-15 13:44 晓风拂月 阅读(179) 评论(0) 推荐(0) 编辑
摘要: --查询表和视图select * from information_schema.tables--查询视图select * from information_schema.views--查询数据库所有表select * from sysobjects where xtype= 'U' and status> 0sp_tables 或: select * from INFORMATION_SCHEMA.TABLES 或: select * from sysobjects where xtype= 'U ' and status> 0sysobjects 阅读全文
posted @ 2011-10-27 14:54 晓风拂月 阅读(922) 评论(0) 推荐(0) 编辑
摘要: //原始操作Rss XmlDocument xml = new XmlDocument(); xml.Load("http://digi.tech.qq.com/mobile/manufacturer/rss_manufacturer.xml"); XmlNodeList list = xml.GetElementsByTagName("item"); foreach (XmlNode node in list) { Response.Write("<a target='_blank' href='" + 阅读全文
posted @ 2011-10-08 16:52 晓风拂月 阅读(331) 评论(0) 推荐(0) 编辑
摘要: var weekDay = ["星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]; var dateStr = "2008-08-08 08:08:08"; var myDate = new Date(Date.parse(dateStr.replace(/-/g, "/"))); alert(weekDay[myDate.getDay()]); 阅读全文
posted @ 2011-09-29 17:43 晓风拂月 阅读(657) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 根据sql 返回受影响的行数(增删改) /// </summary> /// <param name="sql"></param> /// <returns></returns> public static int ExecuteSql(string sql) { int rs = 0; using (SqlConnection conn = new SqlConnection(connString)) { conn.Open(); try { SqlCommand 阅读全文
posted @ 2011-09-28 13:56 晓风拂月 阅读(196) 评论(0) 推荐(0) 编辑