摘要: //截图 RenderTargetBitmap RenderVisaulToBitmap(Visual vsual, int width, int height) { var rtb = new RenderTargetBitmap(width, height, 96, 96, PixelForma 阅读全文
posted @ 2018-03-06 18:05 程序猿kid 阅读(303) 评论(0) 推荐(0) 编辑
摘要: XAML代码 < TextBox Height="23" HorizontalAlignment="Left" Margin="100,5,0,0" Name="textBox1" VerticalAlignment="Top" Width="120" DataObject.Pasting="tex 阅读全文
posted @ 2018-03-06 18:04 程序猿kid 阅读(500) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/WangJinYang/p/3553792.html写的很好转了 阅读全文
posted @ 2018-03-06 17:25 程序猿kid 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Regex r = new Regex("abc"); // 定义一个Regex对象实例(Regex r = new Regex("abc", RegexOptions.IgnoreCase);//不区分大小写的正则) Match m = r.Match("123abc456"); // 在字符串中 阅读全文
posted @ 2018-03-06 17:24 程序猿kid 阅读(345) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 二分法查找 /// </summary> /// <param name="arr"></param> /// <param name="key">要查找的对象</param> public static int BinarySearch(int[] arr,in 阅读全文
posted @ 2018-03-06 17:24 程序猿kid 阅读(3214) 评论(0) 推荐(0) 编辑
摘要: string 转换成 Char[] string ss = "abcdefg"; char[] cc = ss.ToCharArray(); Char[] 转换成string string s = new string(cc); 此外,byte[] 与 string 之间的装换 byte[] bb 阅读全文
posted @ 2018-03-06 17:23 程序猿kid 阅读(2246) 评论(0) 推荐(0) 编辑
摘要: 字符串:string s = "1,2,3,4,5," 目标:删除最后一个 "," 方法:1、用的最多的是Substring,这个也是我一直用的s = s.Substring(0,s.Length - 1)2、用TrimEnd,这个东西传递的是一个字符数组 s=s.TrimEnd(',')//如果要 阅读全文
posted @ 2018-03-06 17:22 程序猿kid 阅读(31994) 评论(1) 推荐(1) 编辑
摘要: stream byte 等各类转换 http://www.cnblogs.com/warioland/archive/2012/03/06/2381355.html using (System.Net.WebClient wc = new System.Net.WebClient()) { wc.D 阅读全文
posted @ 2018-03-06 17:21 程序猿kid 阅读(490) 评论(0) 推荐(0) 编辑
摘要: private bool DownloadPicture(string picUrl, string savePath, int timeOut) { bool value = false; WebResponse response = null; Stream stream = null; try 阅读全文
posted @ 2018-03-06 17:19 程序猿kid 阅读(160) 评论(0) 推荐(0) 编辑
摘要: public DateTime FromUnixTime(long unixTime) { var epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); return epoch.AddMilliseconds(unixTime); 阅读全文
posted @ 2018-03-06 17:17 程序猿kid 阅读(257) 评论(0) 推荐(0) 编辑