zoukankan      html  css  js  c++  java
  • c#产生随机颜色

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.Drawing;

    public partial class Default2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            string k = getStrColor();
           
            Label1.ForeColor=System.Drawing.Color.FromName( getStrColor());

          // Label1.ForeColor=Color.FromArgb(random.Next(255),random.Next(255),random.Next(255));

        }
        private static Random rand = new Random();

        public static string getStrColor()
        {
            Color color = Color.FromArgb(rand.Next());
            string strColor = "#" + Convert.ToString(color.ToArgb(), 16).PadLeft(8, '0').Substring(2, 6);
            return strColor;
        }
      
    }

  • 相关阅读:
    es操作
    MySQL逻辑架构
    ceshimd
    mysql资料
    已解决 : VMware Workstation 与 Hyper-V 不兼容。请先从系统中移除 Hyper-V 角色
    MySQL数据库操作
    phpstorm配置laravel语法提示
    MySQL日志之慢查询日志(slow-log)
    456
    topcoder srm 553
  • 原文地址:https://www.cnblogs.com/EWall/p/1940839.html
Copyright © 2011-2022 走看看