:comboBox1.
PRo
PErtyInfo[] properties;
ArrayList colors;
Color color;
// Solid
brush brush;
properties = typeof (Color).GetProperties (BindingFlags.P
ublic | BindingFlags.
static);
colors = new ArrayList ();
for
each (PropertyInfo prop in properties)
{
// get the value of this static property
color = (Color) prop.GetValue (null, null);
// skip colors t
hat are not interesting
if (color
== Color.Transparent) continue;
if (color == Color.Empty) continue;
try
{
ddlList.Items.Add(prop.Name);
}
catch
{
}
// create a solid brush of this color
//brush = new SolidBrush (color);
//colors.Add (brush);
}
A. 新建一个文本文件,文件名使用*.udl(比如:myDB.udl),此时发现图标变成数据库连接的图标了。
B. 双击此文件,弹出数据连接属性的
框,此时你可以进行设置了。一般地,我们首先选择“提供程序”的选项卡,进行设置之后,再设置“连接”选项卡的相关属性,其他的我就不说了。设置好之后,最后按“确定”。可能会有相应的提示,你自己看着办吧。
C. 用记事本打开你刚才的这个文件。里面有类似这样的字符串: