• 大小: 3.69MB
    文件类型: .rar
    金币: 2
    下载: 0 次
    发布日期: 2024-02-02
  • 语言: Java
  • 标签: 万年历  c#  

资源简介

福建莆田第十中学徐建伟大师java版寿星万年历精准而信息全面,网上大神翻译为C#版。但经过测试,俺发现有一点瑕疵:公元前721年至公元前104年输入会报错,对照原版Java程序,进行了一点修改。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using SharpSxwnl;
using System.IO;
using System.Globalization;
using System.Text.Regularexpressions;
using System.xml;

namespace TestSharpSxwnl
{
    public partial class frmMain : Form
    {
        Lunar lun = new Lunar();
        double curJD curTZ;
        sun_moon smc = new sun_moon();
        string TempPath = ““;

        public frmMain()
        {
            InitializeComponent();
        }


        #region 初始化 显示当前日期所在月的月历
        private void frmMainTest_Load(object sender EventArgs e)
        {
            this.TempPath = this.AddBS(Environment.GetEnvironmentVariable(“Temp“));
            this.cmbBaziTypeS.SelectedIndex = 0;

            DateTime nowDT = DateTime.Now;
            this.curTZ = TimeZone.CurrentTimeZone.GetUtcOffset(nowDT).Negate().TotalHours;     // 中国: 东 8 区
            this.curJD = LunarHelper.NowUTCmsSince19700101(nowDT) / 86400000d - 10957.5 - this.curTZ / 24d; //J2000起算的儒略日数(当前本地时间)
            JD.setFromJD(this.curJD + LunarHelper.J2000);

            this.Caly_y.Text = JD.Y.ToString();

            this.Cml_y.Text = JD.Y.ToString();
            this.Cml_m.Text = JD.M.ToString();
            this.Cml_d.Text = JD.D.ToString();
            this.Cml_his.Text = JD.h + “:“ + JD.m + “:“ + JD.s.ToString(“F0“).PadLeft(2 ‘0‘);

            this.Cal_y.Text = JD.Y.ToString();
            this.Cal_m.Text = JD.M.ToString();
            this.curJD = LunarHelper.int2(this.curJD + 0.5);

            this.InitComboBoxes();

            this.ML_calc(BaZiType.ZtyBaZi);
            this.getlunar();

            this.timerTick.Enabled = true;
            this.showClockAndSunMoonInfo();

        }
        #endregion


        #region 生成和显示月历
        private void btnGo_Click(object sender EventArgs e)
        {
            this.getlunar();
        }

        private void getlunar()
        {
            double By = LunarHelper.year2Ayear(this.Cal_y.Text);
            //// C#: 注: 使用上句也可以 如果在调用泛型方法时 不指定类型 C# 编译器将自动推断其类型
            //double By = LunarHelper.year2Ayear(this.Cal_y.Text);    // 自动推断类型为: string 
            double Bm = int.Parse(this.Cal_m.Text);
            lun.yueLiHTML((int)By (int)Bm this.curJD);
            this.txtPg0_Text.Text = lun.pg0_text;
            this.txtPg1_Text.Text = lun.pg1_text;
            this.txtPg2_Text.Text = lun.pg2_text;

            this.showMessD(-2);

            this.StrToFile(“ta http-equiv=Content-Type content=‘text/html; charset=utf-8‘>“ + lun.pg0 +
                           “

“ + lun.pg1 + “

“ + lun.pg2 +
                           “\r\n ript language=‘javascript‘>“ +
                           “\r\n function changeBackcolor(oTdOfDay setBackcolor) {“ +
                           “\r\n if(oTdOfDay == n

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       5732  2014-06-24 23:14  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\AppSharpSxwnl.csproj

     文件        453  2014-06-24 16:17  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\AppSharpSxwnl.csproj.user

     文件     595968  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\AppSharpSxwnl.exe

     文件      62976  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\AppSharpSxwnl.pdb

     文件      22704  2014-06-26 10:14  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\AppSharpSxwnl.vshost.exe

     文件        490  2010-03-17 22:39  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\AppSharpSxwnl.vshost.exe.manifest

     文件     122880  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\SharpSxwnl.dll

     文件     138752  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\SharpSxwnl.pdb

     文件      76594  2009-04-23 11:26  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\bin\Release\SharpSxwnl.xml

     文件     270398  2014-06-24 23:19  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\calendar (2).ico

     文件      40204  2014-06-25 14:47  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\frmMain.cs

     文件      36803  2014-06-24 23:21  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\frmMain.Designer.cs

     文件     412082  2014-06-24 23:21  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\frmMain.resx

     文件       6690  2014-06-24 22:10  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\frmMethods.cs

     文件      17370  2014-06-24 22:10  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\frmMethods.Designer.cs

     文件       5814  2009-04-16 21:15  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\frmMethods.resx

     文件       6020  2014-06-26 15:26  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\AppSharpSxwnl.csproj.FileListAbsolute.txt

     文件        912  2014-06-26 15:26  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\AppSharpSxwnl.csproj.GenerateResource.Cache

     文件       6331  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\AppSharpSxwnl.csprojResolveAssemblyReference.cache

     文件     595968  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\AppSharpSxwnl.exe

     文件      62976  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\AppSharpSxwnl.pdb

     文件        180  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\AppSharpSxwnl.Properties.Resources.resources

     文件        791  2014-06-24 16:37  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\DesignTimeResolveAssemblyReferences.cache

     文件       6466  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\DesignTimeResolveAssemblyReferencesInput.cache

     文件       4608  2014-06-24 23:12  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\TempPE\Properties.Resources.Designer.cs.dll

     文件       1313  2014-06-24 16:14  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\TestSharpSxwnl.csproj.FileListAbsolute.txt

     文件        920  2014-06-24 16:14  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\TestSharpSxwnl.csproj.GenerateResource.Cache

     文件       6307  2014-06-24 16:14  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\TestSharpSxwnl.csprojResolveAssemblyReference.cache

     文件     270964  2014-06-26 16:46  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\TestSharpSxwnl.frmMain.resources

     文件        180  2014-06-24 17:51  SharpSxwnl-vs2013-v1.0\AppSharpSxwnl\obj\Release\TestSharpSxwnl.frmMainTest.resources

............此处省略126个文件信息

评论

共有 条评论