GDI+方面的: 二十二、GDI+入门介绍: using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; public class Form1 : System.Windows.Forms.Form { private System.ComponentModel.Container components = null; public Form1() { InitializeComponent(); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code private void InitializeComponent() { this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(292, 273); this.Name = Form1; this.Text = Form1; this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint); } #endregion [STAThread] static void Main() { Application.Run(new Form1()); } private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { Graphics g=e.Graphics; g.DrawLine(new Pen(Color.Blue),10,10,210,110); g.DrawRectangle(new Pen(Color.Red),10,10,200,100); g.DrawEllipse(new Pen(Color.Yellow),10,150,200,100); } } XML方面的: 二十三、读取XML文件: using System; using System.Xml; class TestReadXML { public static void Main() { XmlTextReader reader = new XmlTextReader(C:\\test.xml); reader.Read(); while (reader.Read()) { reader.MoveToElement(); Console.WriteLine(XmlTextReader Properties Test); Console.WriteLine(===================); |