国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

ASP.NET取得所有顏色值示例

2024-07-10 13:27:21
字體:
來源:轉載
供稿:網友
(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;即可。
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 呼图壁县| 杂多县| 新密市| 郓城县| 阿克苏市| 昔阳县| 道真| 万全县| 大悟县| 高雄市| 乡城县| 盐山县| 永泰县| 抚州市| 方山县| 新竹县| 平泉县| 神农架林区| 楚雄市| 香格里拉县| 阜南县| 壶关县| 安顺市| 沾益县| 荆州市| 政和县| 察雅县| 恩施市| 罗平县| 嘉善县| 邳州市| 冕宁县| 景德镇市| 深泽县| 都昌县| 通山县| 全椒县| 海林市| 得荣县| 尚义县| 太谷县|