摘要:编程中免不了要使用容器对象来容纳若干数量的对象。微软的.NET编程平台真是两个字--方便。它提供了一个ArrayList对象,满足了编程时对容器对象的大部分需求。但是,真是如此吗? ArrayList主要提供了一种基于索引的容器,但是,它又提供了Contains函数,以至于可以自己编写按内容查找的函数,但这并不一定高效。实际上,很多情况下,使用基于键的容器更为方便,减少遍历,函数效率显然会增加不少...
阅读全文
摘要:Where you once used Regsvr32 on unmanaged COM libraries, you will now use Regasm on managed .NET libraries. “Regsvr32 is the command-line tool that registers .dll files as command components in the re...
阅读全文
摘要:The following code won't work, because conn goes out of scope before you enter the catch block. try { Connection conn = new Connection(); conn.Open(); } ...
阅读全文
摘要:No. While Generic types do have a similar syntax to C++ templates, they are instantiated at runtime as opposed to compile time, and they can be reflected on via meta-data. Also, in Generics, member ...
阅读全文
摘要:When performing any action on a control which requires the updating of a user interface element (e.g. setting the Text property on almost any class derived from Control, updating the data source behin...
阅读全文
摘要:If you set a property on a Windows Forms control which forces the creation of the control (e.g. the SelectedIndex property on the ComboBox class), the control (and perhaps the rest of the form) w...
阅读全文
摘要:Delegates require information about the type that the method is associated with in order to make a call. In a single app-domain, this isn't a problem, because the server (the object firing the e...
阅读全文
摘要:Q: Why does C#'s iterators feature spit out a class definition instead of a struct definition? The iterators feature in C# generates classes that implement the enumerators required. This is detailed...
阅读全文
摘要:Posted by: Duncan Mackenzie, MSDNThis post applies to Visual C# .NET 2002/2003 Suppose you want to run a command line application, open up another Windows program, or even bring up the default web bro...
阅读全文
摘要:Refer to the System.Threading namespace on MSDN for full details. Meanwhile here is a quick taste. using System; using System.Threading; class ThreadTest { public void Runme() { ...
阅读全文
摘要:C# does not support an explicit fall through for case blocks (unless the block is empty) For an explanation of why, see Why is the C# switch statement designed to not allow fall through, but still re...
阅读全文
摘要:了解在 ADO.NET 中对于从您的数据源访问元数据的增强支持。 文章太长,点击此阅读全文
阅读全文
摘要:今天写了一段Excel宏,当根据模版创建Excel时,某些cell的内容自动根据当前机器环境填充。 写的很笨拙,因为不太熟悉VBA和Office事件,全看着帮助完成的。高手若能指点一二,敬请留言啊 Private Sub Workbook_Open()Dim str As Stringstr = Trim(Range("G22").Value)If str = "" ThenRange("G2...
阅读全文
摘要:关于JAVA匿名内部类的一点讨论.基本理论:-----------------------------------------------------关于JAVA内部类:一个内部类的定义是定义在另一个类内部的类。 存在它的原因是: 1.一个内部类的对象能够访问创建它的对象的实现,包括私有数据。即内部类实例对包含它的哪个类的实例来说,是特权的。 2.对于同一个包中的其他类来说,内部类能够...
阅读全文
摘要:查阅相关法律后,办理签证,需要如下物件:1.护照;2.照片(2张,1寸)3.在职证明,需公司出具(原件1,复印件1)4.公司的营业执照(复印件2)5.身份证(复印件2)6.户口簿(原件,复印件2),如果没有原件,必须说明正当理由。7.暂住证(复印件2)8.签证邀请函(如果有,可以很快办理签证,否则,你只有等!)
阅读全文
摘要:Dim intI As LongDim maxLong As LongDim cell As StringDim sum As Longsum = 0maxLong = 65532For intI = 2 To maxLong cell = "h" + LTrim(Str(intI)) If IsNumeric(Range(cell)) Then sum = sum + ...
阅读全文