.net经验
Lloyd2008
这个作者很懒,什么都没留下…
展开
-
.NET截取指定长度汉字超出部分以"..."代替
[code="java"] /// /// 将指定字符串按指定长度进行剪切, /// /// 需要截断的字符串 /// 字符串的最大长度 /// 超过长度的后缀 /// 如果超过长度,返回截断后的新字符串加上后缀,否则,返回原字符串 public static s...原创 2010-07-23 13:50:49 · 74 阅读 · 0 评论 -
.NET中获取字符串的MD5码
[code="java"] using System.Web.Security; [/code] [code="java"] string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text.ToString(), "MD5"); [/code]原创 2010-07-23 13:57:54 · 75 阅读 · 0 评论 -
ASP.NET根据日期获取星座方法!
[code="java"] /// 返回星座 /// /// /// 日期 /// public static string GetXinZuo(string date) { DateTime d; if (DateTime.TryParse(date, out d)) { ...原创 2010-07-23 17:52:52 · 159 阅读 · 0 评论 -
使用Newtonsoft.Json 序列化 反序列化json
Newtonsoft.Json是一个比较流行的序列化JSON的dll 感觉挺方便的 1.序列化 [code="java"] string content=JavaScriptConvert.SerializeObject(stuList); [/code] stuList 为泛型对象 content接收返回的json字符串; 2反序列化 [code="java"] ...原创 2010-08-19 20:52:50 · 129 阅读 · 0 评论 -
C# 繁体,简体互转
[code="java"] C# 繁体,简体互转 首先对Miscrosoft.VisualBasic类的引用. using Microsoft.VisualBasic; public static string Traditional2Simplified(string str) { //繁体转简体 return (Microsoft...原创 2010-08-31 16:37:43 · 204 阅读 · 0 评论 -
有用的webService
1.IP转城市 http://www.webxml.com.cn/WebServices/IpAddressSearchWebService.asmx 2.天气预报 http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx http://webservice.webxml.com.cn/WebServices/weatherweb...原创 2010-09-27 16:45:15 · 108 阅读 · 0 评论