C # implementation Calculation birthday eight

Source: Internet
Author: User

Form1.cs

? using system;using system.collections.generic;using system.componentmodel;using system.data;using System.Drawing; Using system.linq;using system.text;using system.windows.forms;namespace brithdayeigth{public partial class Form1:for    m {public Form1 () {InitializeComponent ();  } public static string[] Date = {"Koshien", "Yi Yi", "C Yin", "Ding Mao", "Boshin", "already", "Grand Afternoon", "Xinwei", "Ren shen", "decyl unitary", "E", "B Hai", "C Zi",  "Ding-chou", "e-Yin", "B-Mao", "Geng Chen", "Xinsi", "Meridian", "No", "a Shen", "B unitary", "Xu", "Ding Hai", "e son", "ugly", "Geng Yin", "Xin Mao", "Ren Chen", "Decyl", "Jiawu", "B",  "C Shen", "The Rooster", "E Xu", "Hai", "Geng Zi", "xin Ugly", "Yin", "Wang-Mao", "A-chen", "B", "Noon", "Ding Not", "Shen Xu", "B unitary", "Geng Shu", "Xin Hai", "Ren zi", "GUI-chou", "a Yin",    "B-Mao", "C-Chen", "Dingsi", "E-noon", "has not", "Geng Shen", "Mookhyang", "Ren Xu", "Gui Hai"};    public int yearzi=0;      private void Btnok_click (object sender, EventArgs e) {DateTime dt=day.value; int YEAR=DT.      year; int moon = dt.      Month; int date = dt.      DayOfYear;      MessageBox.Show ("Test:" + (year%60-3) + ":" +moon+ ":" +date); Call Get YearMethod of the Birthdate String Yearzi = Yearz (year);      String Moonzi = Moonz (moon,year);      String Dayzi = Dayei (year, date); int hour = Int.     Parse (Hourdate.text);      String hourzi= Hours (hour, date, year);    Txtbrithday.text = yearzi+ "" +moonzi+ "" +dayzi+ "" +hourzi; } private void Form1_Load (object sender, EventArgs e) {}//Get the year's Birthday method public string Yearz (int y) {int      Yearzie = Yearnum (y);    return date[yearzie-1];      } public string Moonz (int m,int year) {int yearzie = Yearnum (year);        if (Yearzie >=) {if (yearzie% = = 6 | | Yearzie% = = 1) {return date[2+m-1];        } else if (yearzie% = = 2 | | Yearzie% = = 7) {return date[14 + m-1];        } else if (yearzie% = = 3 | | Yearzie% = = 8) {return date[26 + m-1];        } else if (yearzi% = = 4 | | Yearzi% = = 9) {return date[38 + m-1]; } else if (Yearzie% 10= = 5 | | Yearzie% = = 0) {return date[50 + m-1 > 60?        (m-11): + + M];        }} else {if (Yearzie = = 6 | | yearzie = = 1) {return date[2 + m-1];        } else if (Yearzie = = 2 | | yearzie = = 7) {return date[14 + m-1];        } else if (Yearzie = = 3 | | yearzie = = 8) {return date[26 + m-1];        } else if (Yearzi = = 4 | | yearzi = = 9) {return date[38 + m-1]; } else if (yearzie== 5 | | yearzie = = ten) {return date[50 + m-1>60? (        M-11): 49+m];    }} return date[1];      public string Dayei (int year,int day) {int yearzie = Yearnum (year);    Return date[(Yearzie + day)%60-1];      public string Hours (Int. hour,int day,int year) {Int. yearzie=yearnum (year);      String strh = "";      int datey= (yearzie+day)%60-1;      int datezi=datey%10;   if (Datezi = = 1 | | datezi = = 5) {     STRH + = "armour";      } else if (Datezi = = 2 | | datezi = = 6) {STRH + = "C";      } else if (Datezi = = 3 | | datezi = = 7) {STRH + = "E";      } else if (Datezi = = 4 | | datezi = = 8) {STRH + = "g";      } else if (Datezi = = 5 | | datezi = = 0) {strh + = "Ren";      } if (Hour > 0 && hour <= 1) {strh+= "sub";      } else if (Hour > 1 && hour <= 3) {strh + = "ugly";      } else if (Hour > 3 && hour <= 5) {strh + = "Yin";      } else if (Hour > 5 && hour <= 7) {STRH + = "Mao";      } else if (Hour > 7 && hour <= 9) {strh + = "Chen";      } else if (Hour > 9 && hour <=) {STRH + = "";      } else if (Hour > && hour <=) {strh + = "Noon"; } else if (Hour > && hour <=) {STRH + = "not";      } else if (Hour > && hour <=) {strh + = "shen";      } else if (Hour > && hour <=) {STRH + = "Sub";      } else if (Hour > && hour <=) {STRH + = "unitary";      } else if (Hour > && hour <=) {STRH + = "E";      } else if (Hour > 0 && hour <= 1) {strh + = "Hai";    } return STRH;      } public int Yearnum (int.) {int Yearzie = year% 60-3;      if (Yearzie <= 0) {Yearzie + = 60;    } return Yearzie; }  }}

The above is the whole content of this article, I hope you can enjoy.

In addition to the Declaration, Running GuestArticles are original, reproduced please link to the form of the address of this article
C # implementation Calculation birthday eight

This address: http://www.paobuke.com/develop/c-develop/pbk23089.html






About three keywords in C # params,ref,outc# assembly and reflection detail WinForm pagination control with source code download C # implements the way to compile JavaScript files into DLL files
The implementation of C # graphics area clipping C # How to get the contents of a Web. config file by C # Implement encrypting and decrypting files with the introduction of hosting Process (Vshost.exe) in C # IDE VS2005

C # implementation Calculation birthday eight

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.