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
Ïà¹ØÎĵµ£º
ÔÏÈÒ»Ö±ÓÃBinaryFormatterÀ´ÐòÁл¯Í¦ºÃ£¬¿ÉÊÇ×î½ü·¢ÏÖÔÚWinCEÏÂÊÇûÓа취½øÐÐBinaryFormatter²Ù×÷£¬ºÜ²»Ë¬£¬Ö»ÄܸijÉÁËBinaryWriterºÍBinaryReaderÀ´¶Áд£¬Í»È»Ïëµ½Äܲ»ÄÜÓÃXMLÀ´ÐòÁл¯£¿ÓÚÊÇÔÚÍøÉϲéÁËЩ×ÊÁϱãдÁËЩʵ¼ùÐÔ´úÂ룬×öЩ¼Ç¼£¬±ÜÃâÒÔºóÍü¼Ç¡£
ÐòÁл¯¶ÔÏó
public class People
......
3£©¶ÁÈ¡¡¢²éÕÒ
µ±ÄãÊÖÍ·ÓÐÒ»¸öxmlÎļþºó£¬¿ÉÒÔʹÓÃXmlDocument.Load()·½·¨½«Æä¼ÓÔØ½øÀ´ÒԱ㴦Àí£¬ËùÒÔ“¶ÁÈ¡”ûÓÐʲô¿É˵µÄ¡£¶ø“²éÕÒ”²Ù×÷ÍùÍùÉæ¼°XPath£¬ÕâÀïÖ»ÊÇÎÒÈÏΪµÄ±È½Ï³£Óõ½µÄ²éÕÒ²Ù×÷£¬XPathÕâÍæÒâʵÔÚÊǺÜÇ¿´óºÜ±©Á¦¡£
»ØÍ·¿´Ê¾ÀýÎĵµxmlsample.xml£¬ÎÒÃÇ¿ÉÄÜÓöµ½ÕâÑùµÄÐèÇó£ ......
RT¡£ÏÈÌù´úÂë
C# code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Value_Ref_test1
{
class Program
{
static void Main(string[] args)
{
point a = new point (10,10) ;
point b = a;
......
1.¾²Ì¬³ÉÔ±ºÍ·Ç¾²Ì¬³ÉÔ±µÄÇø±ð£¿
2.const ºÍ static readonly Çø±ð£¿
3.extern ÊÇʲôÒâ˼£¿
4.abstract ÊÇʲôÒâ˼£¿
5.internal ÐÞÊηûÆðʲô×÷Óã¿
6.sealed ÐÞÊηûÊǸÉʲôµÄ£¿
7.override ºÍ overload µÄÇø±ð£¿
8.ʲôÊÇË÷ÒýָʾÆ÷£¿
9.new ÐÞÊηûÊÇÆðʲô×÷Óã¿
10.this ¹Ø¼ü×ֵĺ¬Ò壿
11.¿ÉÒÔʹÓóéÏóº¯Ê ......