Wind-Eagle

No pain,no gain!
posts - 66, comments - 60, trackbacks - 0, articles - 4
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

公告

最新评论

共3页: 1 2 3 下一页 
GoogleInfoWindow,GoogleMarker类及相应的集合类,并给GoogleMap类添加相应的集合属性及其他属性.能否发份给我,谢谢。157775429@qq.com
能把源码发给我一下吗?谢谢!我的邮箱:157775429@qq.com
大哥,小弟最近也在研究地图控件,请问,大哥qq是多少,小弟加个好友好向大哥请教,我的是412742171
封装的非常好,GoogleInfoWindow,GoogleMarker类及相应的集合类,并给GoogleMap类添加相应的集合属性及其他属性 我在你的博客中没有找到.能否发份给我,谢谢。shp_yt@163.com
好东西,收藏了
Re:C#中判断字符是否为中文 Andrew Yin 2010-04-09 18:25  
public static int ChineseLetterCode(string input, int index) { var chfrom = Convert.ToInt32("4e00", 16); //范围(0x4e00~0x9fff)转换成int(chfrom~chend) var chend = Convert.ToInt32("9fa5", 16); if (input != "") { var code = Char.ConvertToUtf32(input, index); return code >= chfrom && code <= chend ? code : 0; } return 0; } public static string ChineseLetterHexCode(string input, int index) { var code = ChineseLetterCode(input, index); return code != 0 ? code.ToString("X4") : string.Empty; } public static string ChineseLetterFromCode(int code) { var chfrom = Convert.ToInt32("4e00", 16); //范围(0x4e00~0x9fff)转换成int(chfrom~chend) var chend = Convert.ToInt32("9fa5", 16); //return code >= chfrom && code <= chend ? Char.ConvertFromUtf32(code) : string.Empty; if (code >= chfrom && code <= chend) { var gb = System.Text.Encoding.GetEncoding("Unicode"); var b = new[] {(byte) (code%0x100), (byte) (code/0x100)}; return gb.GetString(b); } return string.Empty; } public static string ChineseLetterFromHexCode(string hexCode) { var code = int.Parse(hexCode, NumberStyles.HexNumber); return ChineseLetterFromCode(code); } } }
Re:C#中判断字符是否为中文 Andrew Yin 2010-04-09 18:24  
using System; using System.Collections.Generic; using System.Globalization; namespace Encoding { internal class Program { private static void Main(string[] args) { var gb = System.Text.Encoding.GetEncoding("Unicode"); Console.WriteLine(gb.GetBytes("草")); gb = System.Text.Encoding.GetEncoding("UTF-8"); Console.WriteLine(gb.GetBytes("草")); gb = System.Text.Encoding.GetEncoding("GB2312"); Console.WriteLine(gb.GetBytes("啊")); Console.WriteLine(System.Text.Encoding.GetEncoding("Unicode").GetString( Utf8_2_Unicode(System.Text.Encoding.GetEncoding("UTF-8").GetBytes("草xdvsd泥56765@@@@@@@)^%&^%&^$#@#!#$马")))); Console.WriteLine(IsChineseLetter("草泥马", 0)); Console.WriteLine(ChineseLetterCode("草泥马", 0)); Console.WriteLine(ChineseLetterFromCode(ChineseLetterCode("草泥马", 0))); //http://qkzz.net/article/3d697483-a5ae-4b50-9ae9-45dc6dd26141.htm //http://topic.csdn.net/u/20090617/18/1907627e-ce38-4ae5-9755-1cc349a4ed1a.html for (byte i = 0xb0; i < 0xff; i++) { for (byte j = 0xa1; j < 0xfe; j++) { Console.Write(gb.GetString(new[] {i, j})); } } for (var i = 19968; i <= 40959; i++) { Console.Write(ChineseLetterFromCode(i)); } Console.Read(); } /// <summary> /// UTF8 汉字字节流转成 Unicode 汉字字节流 /// </summary> /// <param name="input"></param> /// <see cref="http://hi.baidu.com/hyqsoft/blog/item/263795a164d1728346106464.html"/> public static byte[] Utf8_2_Unicode(byte[] input) { //Array.Reverse(input); var ret = new List<byte>(); for (var i = 0; i < input.Length; i++) { if (input[i] >= 240) // "11110111" { // ReSharper disable RedundantAssignment i += 3; // ReSharper restore RedundantAssignment throw new Exception("四字节的 UTF-8 字符不能转换成两字节的 Unicode 字符!"); } // ReSharper disable RedundantIfElseBlock else if (input[i] >= 224) // ReSharper restore RedundantIfElseBlock { ret.Add((byte) ((input[i + 2] & 63) | ((input[i + 1] & 3) << 6))); ret.Add((byte) ((input[i] << 4) | ((input[i + 1] & 60) >> 2))); i += 2; } else if (input[i] >= 192) { ret.Add((byte) ((input[i + 1] & 63) | ((input[i] & 3) << 6))); ret.Add((byte) ((input[i] & 28) >> 2)); i += 1; } else { ret.Add(input[i]); ret.Add(0); } } return ret.ToArray(); } public static bool IsChineseLetter(string input, int index) { var chfrom = Convert.ToInt32("4e00", 16); //范围(0x4e00~0x9fff)转换成int(chfrom~chend) var chend = Convert.ToInt32("9fa5", 16); if (input != "") { //var code = Char.ConvertToUtf32(input, index); var gb = System.Text.Encoding.GetEncoding("Unicode"); var b = gb.GetBytes(input.Substring(index, 1)); var code = b[0] + b[1]*0x100; return code >= chfrom && code <= chend; } return false; }
Google Map控件封装的不错,学习了,一直关注您的博客! [url=http://www.nestcn.com]http://www.nestcn.com[/url]
Re:ASP.NET MVC中的各种上下文对象 幸运猴子 2009-12-07 16:46  
非常不错,
用IDisposable来做锁,易锁易解。 比以往使用lock( new object())要好。
Re:.NET下的AOP: PostSharp 原理分析 ERic Poon 2009-11-02 16:22  
对文中提到“对程序集”的了解很有兴趣,我们该怎么理解。 谢谢!
不错,能把源码发过来.zjc8282000@126.com
能把源码发给我一下吗?谢谢!我的邮箱:zhangqs008@163.com
re: Anders Liu看学习能力和找工作(转) kevin_077 2009-06-22 17:03  
沙发...
分析得非常切理...
先谢谢了,问个问题,怎么用啊??
.Net 共享内存还是第一次看到,呵呵,正好用到
既然可以用共享内存,为什么不直接用消息(Send/PostMessage)通讯呢? 还是消息会有什么问题?
.Net 共享内存还是第一次看到,呵呵,正好用到
既然可以用共享内存,为什么不直接用消息(Send/PostMessage)通讯呢? 还是消息会有什么问题?
GoogleInfoWindow,GoogleMarker类及相应的集合类,并给GoogleMap类添加相应的集合属性及其他属性 我在你的博客中没有找到. 请问能否把此控件发份我.谢谢 szwmg@163.com
re: PostSharp 原理分析 yu3 2008-12-11 09:15  
我不喜欢POSTSHARP每次需要在前台页面上面写那个属性才可以执行,整个程序看起来不雅观.如果是N层结构,那个[assembly: Trace( Category = "BaseCategory" )]应该写在什么层>???
re: PostSharp 原理分析 brightwang 2008-12-11 07:23  
一个缺点,编译的时候耗时长了。。。
共3页: 1 2 3 下一页