本人只会B/S程序,winform 一点不会,
我在网上找到这个代码,怎么放到winform 里头?这个是winform 里面自动生成的
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;namespace WindowsApplication1
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent(); //
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
} /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null) 
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
// 
// Form1
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load); }
#endregion /// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main() 
{
Application.Run(new Form1());
} private void Form1_Load(object sender, System.EventArgs e)
{

}
}
}
以下是我在网上找到的
using System; namespace CNCalendar 

public class CNDate 

private const ushort START_YEAR = 1901; 
private const ushort END_YEAR = 2050; 
private string[] ConstellationName = 

"白羊座", "金牛座", "双子座", 
"巨蟹座", "狮子座", "处女座", 
"天秤座", "天蝎座", "射手座", 
"摩羯座", "水瓶座", "双鱼座"}; 
private string[] LunarHolDayName = 

"小寒", "大寒", "立春", "雨水", 
"惊蛰", "春分", "清明", "谷雨", 
"立夏", "小满", "芒种", "夏至", 
"小暑", "大暑", "立秋", "处暑", 
"白露", "秋分", "寒露", "霜降", 
"立冬", "小雪", "大雪", "冬至"}; //中间省略很多............................................public class Test 

static void Main(string[] args) 

CNDate dt = new CNDate(DateTime.Today); 
Console.WriteLine("今天是:" + dt.Date.ToString() + dt.GetConstellationName()); 
Console.WriteLine(dt.l_GetLunarHolDay()); 
Console.WriteLine(dt.GetLunarHolDay()); 
Console.WriteLine("闰月" + dt.GetLeapMonth(UInt16.Parse(args[0]))); 
Console.WriteLine("2月的天数" + dt.LunarMonthDays(UInt16.Parse(args[0]), UInt16.Parse(args[1]))); 
Console.WriteLine("天数" + dt.LunarYearDays(UInt16.Parse(args[0]))); 
Console.WriteLine("" + dt.FormatLunarYear()); 
dt.Date = DateTime.Today.AddDays(1); 
Console.WriteLine("明天是:" + dt.Date.ToString() + dt.GetConstellationName()); 

} //class Test