• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
If She Said "Yes".
What'll you do ?
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 2 3 4 下一页
2011年8月16日
如何移除h1与p之间的间距:临近选择符
摘要: 对于h1和p,浏览器自动会为他们加上margin-top和margin-bottom。 <h1> Obama says Warren Buffett is right about taxes </h1> <p > CANNON FALLS, Minnesota (Reuters) - Small-town Americans probably don't make as much money as Warren Buffett, but they pay more of their income in taxes, President Barack 阅读全文
posted @ 2011-08-16 17:19 百花盛开 阅读(1756) 评论(0) 推荐(0)
举例说明如何实现一个泛型类
摘要: 首先,我们以“创建一个简单的、未实现泛型的、能包含任何类型的链表类”作为切入点;然后我们再对其改装成支持泛型的列表类。 我们都知道“链表”内部总是一个元素连接到下一个元素,所以我们需要创建一个类来表示其中的每一个节点。这个节点类,需要包含三个信息:1.之前的节点 2.本节点 3.之后的节点。 基于以上的分析,我们得到了节点类LinkedListNode: View Code public class LinkedListNode { public object Value { get; private set; } public LinkedListNode(object value) { . 阅读全文
posted @ 2011-08-16 16:27 百花盛开 阅读(731) 评论(0) 推荐(0)
2011年8月5日
使用泛型的好处:类型安全
摘要: “类型安全”简单说来就是:没有泛型之前,如果你把int,string,class类型都通过Add()方法添加到一个集合类中,这样明显不可以的,但是编译器在编译时却发现不了这个问题,非得要执行是才报错。有了泛型之后,如果你把string添加到List<int>中,那么在编译期间,IDE就会给你报错。 //以下代码会在运行时出现错误ArrayList list = new ArrayList();list.Add(4);list.Add("myString");list.Add(new MyClass);foreach(int item in list){ Cons 阅读全文
posted @ 2011-08-05 11:37 百花盛开 阅读(452) 评论(0) 推荐(0)
使用泛型的好处:性能
摘要: [原] 题记:当我们平时需要使用到集合类时,我们会发现类的头部导入了这个命名空间:System.Collections.Generic(这其实是泛型的英文名称)。 因为我没有使用过CLR1.0,所以之前对微软命名空间的划分有点恼火。既然是集合类,干嘛不直接放在System.Collections里。当看了泛型之后才明白其中的缘由。 在CLR1.0中,集合类是没有实现泛型的(当时,泛型还没有出生呢),到了CLR2.0时,引入了泛型的概念,于是微软把原先的集合类重写了一边,以实现泛型。所以才有了现在的System.Collections.Generic这个命名空间。 之所以说泛型提高了性能,就在于 阅读全文
posted @ 2011-08-05 11:26 百花盛开 阅读(1884) 评论(0) 推荐(0)
C# 泛型介绍
摘要: [原] 泛型是CLR2.0中的新特性。 场景: 在CLR1.0中,如果要创建一个灵活的类或方法,但是该类或方法在编译期间并不能确定所使用的是什么类。 方案: 要解决这种问题,我们必须以Object类为基础。 弊端: 比如现在有一个方法:public string doSomething(Object item){ ....} 这个方法既可以传进引用类型,也可以传入值类型。(在设计这个方法时,我们不能确定参数到底是引用类型,还是值类型。即使知道是引用类型,那么使用的是什么类,我们也不能 知道。所以我们把这个参数定义为Object) 从表面上来看,这种解决方案很美好,至少我实现了需求(编译期间无法 阅读全文
posted @ 2011-08-05 10:55 百花盛开 阅读(132) 评论(0) 推荐(0)
2011年7月26日
FlexGlobals.topLevelApplication
该文被密码保护。 阅读全文
posted @ 2011-07-26 09:55 百花盛开 阅读(16) 评论(0) 推荐(0)
2011年7月14日
Taskbar height in Windows OS ?
摘要: [source adress]http://cookbooks.adobe.com/post_Taskbar_height_in_Windows_OS__-10823.htmlProblemI want to alert my users like MSN alert when new user login or new email , but i can't determine the height of the taskbar to display my alert window above it :( .SolutionMake new invisible window with 阅读全文
posted @ 2011-07-14 18:51 百花盛开 阅读(250) 评论(0) 推荐(0)
2011年7月12日
The SqlCommand Object
摘要: [Source adress]http://www.csharp-station.com/Tutorials/AdoDotNet/Lesson03.aspxThis lesson describes the SqlCommand object and how you use it to interact with a database. Here are the objectives of this lesson:Know what a command object is.Learn how to use the ExecuteReader method to query data.Learn 阅读全文
posted @ 2011-07-12 16:12 百花盛开 阅读(219) 评论(0) 推荐(0)
2011年7月11日
How to change the state of a compontent outside of that compontent
该文被密码保护。 阅读全文
posted @ 2011-07-11 13:39 百花盛开 阅读(8) 评论(0) 推荐(0)
2011年7月6日
Using a Delete button to a DataGrid to remove rows.
摘要: ProblemI'd like to have a Delete button in a DataGrid column, and when that button is clicked, that row of the DataGrid is removed.SolutionIn the Delete button click handler, access the DataGrid dataProvider and use the selectedIndex property to delete the item.Detailed explanationI'd like t 阅读全文
posted @ 2011-07-06 13:23 百花盛开 阅读(223) 评论(0) 推荐(0)
上一页 1 2 3 4 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3