用C#编写ActiveX控件(一) 前些日子做一个Web项目,必须自己编写一个ActiveX控件。如今的ActiveX控件大多是使用VB/C++来开发的,而我对他们并不熟悉,因此考虑使用熟悉的C#编写ActiveX控件。 首先,建立一个WinForm控件项目HelloWorld,并拖入一个Label控件,文字设为HelloWorld,如图: UserControl1.cs内容如下: using System; using S...[ 查看全文 ]
下面是实现上面结果的程序源代码: using System ; using System.Drawing ; using System.Collections ; using System.ComponentModel ; using System.Windows.Forms ; using System.Data ; namespace DynamicControls { public class Form1 : Form { private Button btnAdd ; private System.ComponentModel.Container components = null ; private Button txtAdd ; //给产生的按钮定义一个数量计算器 pr...[ 查看全文 ]
About program language such as C++, C#, Java and Delphi, how to choose a good one for a freshman ? This view has pointed by many people here and different person have different ideas. In my opnion, , C# is the first choose for anyone. Why? Because it's different from any other language. C# comes from C++ and Java in some extend views. So it's obviouse for C# that it have th...[ 查看全文 ]
1。6 统一系统类型(Type system unification) c#独创了一种类型——统一系统类型(为了这个累刑,我头疼死了。谁有更好的名字,请务必告诉 我)。总之,所有的其他类型,包括值和引用,都可以被当作统一系统类型来对待。从概念上说, 所有的类型都从它派生。这样,其他的类型就可以使用统一系统类型的属性和方法。包括一些“简 单”类型,如:int。还是给个例子吧:*/ using System; class Test { &...[ 查看全文 ]
What is a GUID For those of you who don''t know, a GUID (pronounced goo''id - Globally unique identifier) is a 128-bit integer that can be used to uniquely identify something. You may store users or products in your database and you want somehow uniquely identify each row in the database. A common approach is to create a autoincrementing integer, another way would be to creat...[ 查看全文 ]