[推荐]asp.net string与color互换

 string转换成color 

            string col = "#FF8400";
            this.BackColor = System.Drawing.ColorTranslator.FromHtml(col);

color转换成string

           Color mycolor = this.BackColor;
            string strcol = System.Drawing.ColorTranslator.ToHtml(mycolor);
            MessageBox.Show(strcol);

posted @ 2008-08-24 10:21  refuly  阅读(293)  评论(1编辑  收藏  举报