rt

解决方案 »

  1.   

    to welshem(天堂客) 
    不太懂,能否举个小例子?
      

  2.   

    class ClassA {
       public static event DelegateName Ev;
    }
    实际编译为如下语句:
    class  ClassA  {
       private static DelegateName __Ev;
       public static event DelegateName Ev {
          add {
             lock(typeof(ClassA)) { __Ev = __Ev + value; }
          }
          remove {
             lock(typeof(ClassA)) { __Ev = __Ev - value; }
          }
       }
    }
      

  3.   

    public class UserInfo
    {

    #region 用户Session信息的定义        private string _UserName;


    /// <summary>
    /// session中的用户名
    /// </summary>
    public string UserName
    {
    get
    {
    return _UserName;
    }
    set
    {
    _UserName = value;
    }
    }           }
      

  4.   

    public class CommonFunc
    {
         #region 着色
        public static string SetColor(string str,Color color)
        {
    string colorRGB= ColorTranslator.ToHtml(color);
    return "<font color='"+colorRGB+"'>"+str+"</font>";
        }
        #endregion}你在程序中就可以调用返回值了。
    Label.Text=CommonFunc.SetColor();