asp.net取得所有颜色值实例
来源:互联网 发布:淘宝店铺手机端代码 编辑:程序博客网 时间:2024/06/10 06:10
asp.net获取颜色值的方法
1,如何将电脑中可用字体加入winform中的combobox中:
combobox1.items.addrange (fontfamily.families);
复制代码
2,取得所有可用颜色并填充到asp.net的下拉菜单中:
propertyinfo[] properties;
arraylist colors;
color color;
// solidbrush brush;
properties = typeof (color).getproperties (bindingflags.public | bindingflags.static);
colors = new arraylist ();
foreach (propertyinfo prop in properties)
{
// get the value of this static property
color = (color) prop.getvalue (null, null);
// skip colors that 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);
}
3,如何取得数据库的连接字符串?
a,新建一个文本文件,文件名使用*.udl(比如:mydb.udl),此时发现图标变成数据库连接的图标了。
b,双击此文件,弹出数据连接属性的对话框,此时你可以进行设置了。
一般首先选择“提供程序”的选项卡,进行设置之后,再设置“连接”选项卡的相关属性,其他的我就不说了。
设置好之后,最后按“确定”。可能会有相应的提示,比较好解决,根据情况自己确定。
c,用记事本打开刚才的这个文件。
其中有类似这样的字符串:
provider=sqloledb.1;password=123456sa;persist security info=true;user id=sa;initial catalog=zpweb;data source=myservername
1,如何将电脑中可用字体加入winform中的combobox中:
combobox1.items.addrange (fontfamily.families);
复制代码
2,取得所有可用颜色并填充到asp.net的下拉菜单中:
propertyinfo[] properties;
arraylist colors;
color color;
// solidbrush brush;
properties = typeof (color).getproperties (bindingflags.public | bindingflags.static);
colors = new arraylist ();
foreach (propertyinfo prop in properties)
{
// get the value of this static property
color = (color) prop.getvalue (null, null);
// skip colors that 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);
}
3,如何取得数据库的连接字符串?
a,新建一个文本文件,文件名使用*.udl(比如:mydb.udl),此时发现图标变成数据库连接的图标了。
b,双击此文件,弹出数据连接属性的对话框,此时你可以进行设置了。
一般首先选择“提供程序”的选项卡,进行设置之后,再设置“连接”选项卡的相关属性,其他的我就不说了。
设置好之后,最后按“确定”。可能会有相应的提示,比较好解决,根据情况自己确定。
c,用记事本打开刚才的这个文件。
其中有类似这样的字符串:
provider=sqloledb.1;password=123456sa;persist security info=true;user id=sa;initial catalog=zpweb;data source=myservername
如果使用sqlserver数据库,将provider=sqloledb.1;改为:server=localhost;即可。
0 0
- asp.net取得所有颜色值实例
- ASP.NET取得所有颜色值的方法
- asp.net取得所有颜色值的方法
- asp.net grid控件常用取得所有勾选checkbox值
- ASP.NET取得Request URL 值
- asp.net取得弹窗返回值
- ASP.net取得绝对路径
- ASP.NET 取得客户端信息
- Asp.Net取得服务端信息
- asp.net 取得访问者信息
- ASP.NET 取得客户端信息
- ASP.NET取得客户端信息
- ASP.net取得主机名方法
- asp.net如何取得纯客户端控件的值
- asp.net如何取得纯客户端控件的值
- ASP.net(c#)取得CheckBoxList(复选框)的值
- asp.net如何取得纯客户端控件的值
- asp.net如何取得纯客户端控件的值
- 也谈layout的自动换行兼横向居中
- LeetCode: Permutation Sequence
- configure: error: --with-ssl was given, but GNUTLS is not available.
- AMD移动双显卡驱动14.4_WHQL正式版64位_byTimer0677
- 如何判断PHP 是线程安全还是非线程安全的
- asp.net取得所有颜色值实例
- 【Go web开发之revel+mgo】第8章 实现Email墙
- Android开发之Json的解析
- css中长度单位px、em、pt的区别
- c++-赋值与初始化的区别
- Call for Papers IEEE/ACM ASONAM (Social Network Analysis and Mining )
- JAVA笔记 变量的使用规则
- LeetCode: Add Binary
- Android开源项目第一篇——个性化控件(View)篇