上一页 1 2 3 4 5 6 7 8 ··· 19 下一页
摘要: The FindControl method of the System.Web.UI.Control class appears simple enough to use. In fact, the MSDN description of the method is one simple sentence: Searches the current naming container for the specified server control.The key to using FindControl is to invoke the method on the correct conta 阅读全文
posted @ 2014-02-27 17:42 zzg168 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 原题如下:12(a桶 满的 有12斤油)斤桶里 取出6斤油 有 另外有8斤(b桶)和5斤(c桶)两个空桶 让程序输出取出这6斤油的步骤现在实现的算法可以配参数(定义有几个桶,初始有多少油,要得到多少油,都可以配),并且找出任意(多条线路或者找不到)满足条件的倒油线路图:运行效果:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->using System;using System.Collections.Generic;using System. 阅读全文
posted @ 2014-02-27 17:41 zzg168 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 一.使用OleDb,这个法子好像不大好使.容易读错.引用System.Data.OleDb;/**///////返回Excel数据源//////文件路径///staticpublicDataSetExcelToDataSet(stringfilename){DataSetds;stringstrCon="Provider=Microsoft.Jet.OLEDB.4.0;"+"ExtendedProperties=Excel8.0;"+"datasource="+filename;OleDbConnectionmyConn=newOle 阅读全文
posted @ 2014-02-27 17:40 zzg168 阅读(492) 评论(0) 推荐(0) 编辑
摘要: 1///2///提取字符串中的数字字符串3///4///5///6publicstaticstringIsNumber(Stringstr)7{8stringreturnStr=string.Empty;9for(inti=0;i<str.Length;i++)10{11if(Char.IsNumber(str,i)==true)12{13returnStr+=str.Substring(i,1);14}15else16{17if(str.Substring(i,1)=="A"||str.Substring(i,1)=="")18{19return 阅读全文
posted @ 2014-02-27 17:37 zzg168 阅读(266) 评论(0) 推荐(0) 编辑
摘要: MFC 生成本机代码,自然是很快。可是,消息循环,减缓了界面显示速度。winform 封装了 win32 的api,多次进行P/invoke 操作 (大部分使用p/invoke操作封装),速度慢 。wpf是一种新的模型,不再使用win32 模型,自己新建模型,使用dx 作为新的显示技术,直接访问驱动程序,加快了运行速度,可是,这种模型,需要支持dx 9 的显卡,硬件要求高(你还能找到现代机器不支持dx9 的吗?)开发效率上,MFC<WPF<winform 尽管MFC开发界面执行效率高但是开发效率低,作为现在的项目开发来说时间跟开发效率往往能决定项目的成败,所以除非有特别的需求,否则 阅读全文
posted @ 2014-02-27 17:36 zzg168 阅读(710) 评论(0) 推荐(0) 编辑
摘要: 这一段公司有个项目,客户要求上传的图片要带上自定义的水印。以前也经常和朋友讨论C#图片水印方面的问题,但是从来没有实际操作过。所以,借这次项目的机会也研究了一下C#图片水印的功能!本人参考的是discuz论坛中的代码。这种方法是直接把要上传的图片先转化成System.Drawing.Image,而不用保存到服务器端的磁盘上,然后加上水印重新绘制,再保存到服务器端的磁盘上,下面就拿出来晒晒:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> 1/ 阅读全文
posted @ 2014-02-27 17:35 zzg168 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 在做WinForm界面布局时,菜单和工具栏必不可少!但是MenuStrip和ToolStrip不能够对边框的样式直接设置,如果想实现菜单和工具栏之间的分割线就不容易实现;今天查阅了一下msdn找到了一个方法,和大家一块分享,如果有更好的办法的话可以贴出来,共同进步; 首先,创建一个CustomProfessionalRenderer类(类名可随便定义)继承自ToolStripProfessionalRenderer。代码如下:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighli 阅读全文
posted @ 2014-02-27 17:34 zzg168 阅读(466) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Data;using System.Configuration;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Xml.Linq;using System.Drawing;namespace Ne 阅读全文
posted @ 2014-02-27 17:32 zzg168 阅读(579) 评论(0) 推荐(0) 编辑
摘要: C#中new和override是继承中经常用到的两个关键字,但是往往有时候容易把这两个关键字的作用搞混淆。newC# new关键字表示隐藏,是指加上new关键字的属性或函数将对本类和继承类隐藏基类的同名属性或函数Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->publicclassA{publicvirtualvoidMethod(){Console.WriteLine("ThisMethodinClassA!");}}p 阅读全文
posted @ 2014-02-27 17:31 zzg168 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 对属性或索引器使用访问修饰符受以下条件的制约:· 不能对接口或显式接口成员实现使用访问器修饰符。· 仅当属性或索引器同时具有 set 和 get 访问器时,才能使用访问器修饰符。这种情况下,只允许对其中一个访问器使用修饰符。· 如果属性或索引器具有 override 修饰符,则访问器修饰符必须与重写的访问器的访问器(如果有的话)匹配。· 访问器的可访问性级别必须比属性或索引器本身的可访问性级别具有更严格的限制。· public class Parent· {· public virtual int TestProperty& 阅读全文
posted @ 2014-02-27 17:30 zzg168 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 19 下一页