随笔分类 -  asp.net

摘要:1、格式化货币(跟系统的环境有关,中文系统默认格式化人民币,英文系统格式化美元)string.Format("{0:C}",0.2) 结果为:¥0.20 (英文操作系统结果:$0.20)默认格式化小数点后面保留两位小数,如果需要保留一位或者更多,可以指定位数 string.Format("{0:C1... 阅读全文
posted @ 2015-06-10 18:28 晓风拂月 阅读(209) 评论(0) 推荐(0)
摘要:class Program { static void Main(string[] args) { long val = 123456789; Console.WriteLine(Parse64Encode(val)); ... 阅读全文
posted @ 2015-05-13 18:56 晓风拂月 阅读(6623) 评论(1) 推荐(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 晓风拂月 阅读(566) 评论(0) 推荐(0)
摘要:public static class LocalCacheHelper { private const int TimeOut = 5; //5分钟过期 public static T GetCache(string cacheKey) { ... 阅读全文
posted @ 2015-05-11 13:49 晓风拂月
该文被密码保护。
posted @ 2014-11-13 09:52 晓风拂月 阅读(1) 评论(0) 推荐(0)
摘要:protected void Page_Load(object sender, EventArgs e) { string str = "abcqqqqqabchahhabcaaabcssssdbsssabcaadcsssabc"; str... 阅读全文
posted @ 2014-04-14 23:01 晓风拂月 阅读(2085) 评论(0) 推荐(0)
摘要:public static class JsonHelper { /// /// Json序列化,用于发送到客户端 /// public static string ToJsJson(this object item) { DataContractJsonSerializer serializer = new DataContractJsonSerializer(item.GetType()); using (MemoryStream ms = new MemoryStr... 阅读全文
posted @ 2013-08-27 15:02 晓风拂月 阅读(8162) 评论(0) 推荐(1)
摘要:网上一直想找一个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 晓风拂月 阅读(11653) 评论(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 晓风拂月 阅读(2021) 评论(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 晓风拂月 阅读(574) 评论(0) 推荐(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 晓风拂月 阅读(14895) 评论(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 晓风拂月 阅读(3011) 评论(0) 推荐(1)
摘要: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 晓风拂月 阅读(565) 评论(0) 推荐(0)
摘要: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 晓风拂月 阅读(3546) 评论(5) 推荐(4)
摘要: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 晓风拂月 阅读(8965) 评论(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 晓风拂月 阅读(9941) 评论(15) 推荐(2)
摘要:使用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 晓风拂月 阅读(6569) 评论(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 晓风拂月 阅读(7600) 评论(4) 推荐(4)