会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
该死的代码
三聪的博客
博客园
首页
新随笔
新文章
联系
订阅
管理
2014年4月30日
流操作
摘要: #region -- 流操作 /// /// 复制流 /// public static MemoryStream CopyStream(Stream stream) { MemoryStream ms...
阅读全文
posted @ 2014-04-30 10:06 三聪
阅读(250)
评论(0)
推荐(0)
2013年8月28日
如何利用.Net内置类,解析未知复杂Json对象
摘要: 如果你乐意,当然可以使用强大的第三方类库Json.Net中的JObject类解析复杂Json字串 。我不太希望引入第三方类库,所以在.Net内置类JavaScriptSerializer.DeserializeObject的基础上做了一些封装,可以方便的读取复杂json中的内容,而无需专门定义对应的类型。等不及看的,直接下载源码: JsonObject.7z(2013-08-29更新,第三版)代码实例:namespace JsonUtils{ class Program { static void Main(string[] args) { ...
阅读全文
posted @ 2013-08-28 09:57 三聪
阅读(7612)
评论(13)
推荐(2)
2013年3月1日
制作等比环切缩缩图
摘要: /// <summary> /// 制作等比环切缩缩图 /// </summary> public static bool MakeThumbnail(Image image, string savePath, int toWidth, int toHeight) { if (File.Exists(savePath)) { File.SetAttributes(savePath, FileAttributes.Normal); File.Delete(savePath); } ...
阅读全文
posted @ 2013-03-01 13:21 三聪
阅读(331)
评论(0)
推荐(0)
2013年2月19日
让window.setTimeout等支持带参数方法
摘要: 在写js时经常会使用到无参或固定参数方法,比如window.setTimeout(func,300) 比如$("input").click(func)等如果我们需要定时执行的一个参多个参数方法,应该如果处理呢?比如有这样一个方法:function log(a, b){ console.log(a + "_" + b);}我们需要定时400毫秒后执行直接用log方法是行不通的:window.setTimeout(log,100); //错误的我们首先想到可行的方法:window.setTimeout(function(){log(1,2)},100);再来
阅读全文
posted @ 2013-02-19 14:42 三聪
阅读(9168)
评论(8)
推荐(4)
2011年9月16日
利用NewID()生成随机数
摘要: CREATEFUNCTION[dbo].[RandInt](@GuidValueasuniqueidentifier)RETURNSintASBEGINdeclare@strasvarchar(10)set@str=left(@GuidValue,8)declare@iasintdeclare@numberasintset@i=0set@number=0while(@i<8)beginset@number=@number+(Ascii((substring(@str,@i+1,1)))*Power(10,@i))set@i=@i+1endreturn@numberEND
阅读全文
posted @ 2011-09-16 17:01 三聪
阅读(420)
评论(0)
推荐(0)
2011年7月13日
创建缩略图
摘要: stringfile=files[i];Imageimg=Image.FromFile(file);intwidth=img.Width;intheight=img.Height;if(width>height){width=800;height=width*img.Height/img.Width;}else{height=800;width=height*img.Width/img.Height;}Bitmapbt=newBitmap(width,height);Graphicsg=Graphics.FromImage(bt);g.DrawImage(img,0,0,width,he
阅读全文
posted @ 2011-07-13 14:11 三聪
阅读(215)
评论(0)
推荐(0)
2011年6月29日
winform给html提供接口
摘要: winform提供皮 privatevoidForm1_Load(objectsender,EventArgse){Externalext=newExternal(this);webBrowser1.ObjectForScripting=ext;}}[System.Runtime.InteropServices.ComVisibleAttribute(true)]publicclassExternal{Formform;publicExternal(Formform){this.form=form;}publicvoidwappFullScreen(boolflag){if(flag){for
阅读全文
posted @ 2011-06-29 23:43 三聪
阅读(416)
评论(0)
推荐(0)
2011年6月14日
IE下记住文本框的光标位置
摘要: 方法一:1//#region--文本框TextArea光标相关2varPos={3//IE版本号4getIEVer:function(){5varmatch=navigator.appVersion.match(/MSIE\s+\d+.0;/);6if(match==null)return-1;7return+match[0].match(/\d+/)[0];8},9getPos:function(textBox){10if(document.selection){11varrange=document.selection.createRange();12varrange_all=docume
阅读全文
posted @ 2011-06-14 10:57 三聪
阅读(1392)
评论(2)
推荐(0)
2011年5月3日
ie下取得iframe里面内容
摘要: ie下:var doc=document.getElementById("frame1").contentWindow.document;alert(x.getElementById('xxx'));非ie下(标准script)var doc=document.getElementById("frame1").contentDocument;alert(x.getElementById('xxx'));如果就jquery就可以兼容了var doc=$("#frame1").contents();aler
阅读全文
posted @ 2011-05-03 15:48 三聪
阅读(297)
评论(0)
推荐(0)
2011年3月30日
短网址计算
摘要: stringchars="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";privatevoidbutton1_Click(objectsender,EventArgse){inti=int.Parse(textBox1.Text);textBox2.Text=EncodeNum(i);textBox3.Text=DecodeNum(textBox2.Text).ToString();}///<summary>///转码///</summary>///<paramn
阅读全文
posted @ 2011-03-30 10:40 三聪
阅读(324)
评论(0)
推荐(0)
下一页
作者:
gateluck
出处:
http://gateluck.cnblogs.com/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。