Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

c# enmu ö¾ÙС½á(2)×Ô¼ºµÄ

ͨ¹ý·´É䣬µÃµ½Õë¶Ôijһö¾ÙÀàÐ͵ÄÃèÊö¡£
ö¾ÙµÄ¶¨ÒåÖмÓÈëÃèÊö
  using System;
using System.Collections;
namespace Ahnlab.ApplicationServices
{
public sealed partial class SysEnums
{


#region ϵͳ¹ÜÀíÄ£¿éµÄö¾ÙÐÅÏ¢
/// <summary>
/// ÔÚÏß²»Á¼Å⳥ЭÒéÊé״̬
/// </summary>
public enum YesNo
{
[TextAttribute("ÊÇ")]
Yes = 0,
[TextAttribute("·ñ")]
No = 1
}
/// <summary>
/// Óû§ÀàÐÍ
/// </summary>
public enum UserType
{
[TextAttribute("¹«Ë¾Ô±¹¤")]
Employee = 1,
[TextAttribute("´úÀíÉÌ")]
Agent = 2,
[TextAttribute("¹©Ó¦ÉÌ")]
Vendor = 3,
[TextAttribute("ϵͳ¹ÜÀíÔ±")]
Admin = 4
}
/// <summary>
/// ÃÜÂëÖØÖñê¼Ç
/// </summary>
public enum PasswordResetEnum
{
[TextAttribute("ÊÇ")]
Yes = 1,
[TextAttribute("·ñ")]
No = 0
}
#endregion
}

/// <summary>
/// ¹¹Ôìö¾ÙÀà
/// add by kenny
/// add date
/// </summary>
public class TextAttribute : Attribute
{
public string Text
{
get
{
return _Text;
}
set
{
_Text = value;
}
}
string _Text;
public TextAttribute(string text)
{
_Text = text;
}
}
 
»ñµÃÖµ Type enumType = typeof(SysEnums.UserType);//ö¾ÙÊôÐÔ
int enumConst = int.Parse(UserType.ToString());//ö¾Ù¶ÔÓ¦µÄÖµ
string textVal = "";
string strValue = string.Empty;
Type typeDescription = typeof(Ahnlab.ApplicationServices.TextAttribute);
FieldInfo fi


Ïà¹ØÎĵµ£º

C#СTip£ºXml²Ù×÷¼òÃ÷ÊÖ²á 3

3£©¶ÁÈ¡¡¢²éÕÒ
µ±ÄãÊÖÍ·ÓÐÒ»¸öxmlÎļþºó£¬¿ÉÒÔʹÓÃXmlDocument.Load()·½·¨½«Æä¼ÓÔØ½øÀ´ÒԱ㴦Àí£¬ËùÒÔ“¶ÁÈ¡”ûÓÐʲô¿É˵µÄ¡£¶ø“²éÕÒ”²Ù×÷ÍùÍùÉæ¼°XPath£¬ÕâÀïÖ»ÊÇÎÒÈÏΪµÄ±È½Ï³£Óõ½µÄ²éÕÒ²Ù×÷£¬XPathÕâÍæÒâʵÔÚÊǺÜÇ¿´óºÜ±©Á¦¡£
 
»ØÍ·¿´Ê¾ÀýÎĵµxmlsample.xml£¬ÎÒÃÇ¿ÉÄÜÓöµ½ÕâÑùµÄÐèÇó£ ......

c# Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary

/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......

C#ÓïÑԹ淶

1. ÃüÃû¹æ·¶
a)    Àà
¡¾¹æÔò1-1¡¿Ê¹ÓÃPascal¹æÔòÃüÃûÀàÃû£¬¼´Ê××ÖĸҪ´óд¡£
¡¾¹æÔò1-2¡¿Ê¹ÓÃÄܹ»·´Ó³À๦ÄܵÄÃû´Ê»òÃû´Ê¶ÌÓïÃüÃûÀà¡£
¡¾¹æÔò1-3¡¿²»ÒªÊ¹ÓÓI”¡¢“C”¡¢“_”µÈÌØ¶¨º¬Òåǰ׺¡£
¡¾¹æÔò1-4¡¿×Ô¶¨ÒåÒì³£ÀàÓ¦ÒÔException½áβ¡£
¡¾¹æÔò1-5¡¿ÎļþÃûÒªÄÜ·´Ó ......

C#ÃæÏò¶ÔÏó »ù´¡¸ÅÄî25¸ö

1.¾²Ì¬³ÉÔ±ºÍ·Ç¾²Ì¬³ÉÔ±µÄÇø±ð£¿
2.const ºÍ static readonly Çø±ð£¿
3.extern ÊÇʲôÒâ˼£¿
4.abstract ÊÇʲôÒâ˼£¿
5.internal ÐÞÊηûÆðʲô×÷Óã¿
6.sealed ÐÞÊηûÊǸÉʲôµÄ£¿
7.override ºÍ overload µÄÇø±ð£¿
8.ʲôÊÇË÷ÒýָʾÆ÷£¿
9.new ÐÞÊηûÊÇÆðʲô×÷Óã¿
10.this ¹Ø¼ü×ֵĺ¬Ò壿
11.¿ÉÒÔʹÓóéÏóº¯Ê ......

C# ʹÓÃPlaySoundÔÚÒÆ¶¯É豸Éϲ¥·ÅÉùÒô

ʹÓà PlaySound ÔÚÒÆ¶¯É豸Éϲ¥·ÅÉùÒôÎļþ¡£´Ë´úÂëʹÓà System.Runtime.InteropServices
µ÷Óà Compact Framework µÄ CoreDll.DLL µÄ PlaySound ·½·¨
¹ØÓÚ²¥·ÅʵÏÖ£º
        //²¥·Å±êÖ¾
        private enum Flags
        {
 &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ