ASP.NET取得全部颜色值示例_.docx

上传人:PIYPING 文档编号:11625578 上传时间:2021-08-26 格式:DOCX 页数:3 大小:12.20KB
返回 下载 相关 举报
ASP.NET取得全部颜色值示例_.docx_第1页
第1页 / 共3页
ASP.NET取得全部颜色值示例_.docx_第2页
第2页 / 共3页
ASP.NET取得全部颜色值示例_.docx_第3页
第3页 / 共3页
亲,该文档总共3页,全部预览完了,如果喜欢就下载吧!
资源描述

《ASP.NET取得全部颜色值示例_.docx》由会员分享,可在线阅读,更多相关《ASP.NET取得全部颜色值示例_.docx(3页珍藏版)》请在三一文库上搜索。

1、ASP.NET取得全部颜色值示例_ 这篇文章主要介绍了ASP.NET取得全部颜色值的方法,需要的伴侣可以参考下 (1)怎样将电脑里有可用字体加入WINFORM中的ComboBox中: 一句话搞定:comboBox1.Items.AddRange (FontFamily.Families); (2)取得全部可用颜色并填充到的下拉菜单中: 代码如下: PropertyInfo properties; ArrayList colors; Color color; / SolidBrush brush; properties = typeof (Color).GetProperties (Bindin

2、gFlags.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) cont

3、inue; 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;即可。 更多信息请查看IT技术专栏 .

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1