NetBlog主题

winForm截图,截当前整个窗体和某个区域
C#基础

winForm截图,截当前整个窗体和某个区域

2907 0

//截取整个窗体 private void button1_Click(object sender, EventArgs e){Bitmap bit=new Bitmap(this.Width,this.Height);//实例化一个和窗体一样大的bitmapGraphics g=Graphics.FromImage(bit);g.CompositingQuality = CompositingQuality.HighQuality;//质量设为最高g.Co…

WinForm ListView对XML增删改查
C#基础

WinForm ListView对XML增删改查

2812 0

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; using System.Xml;namespace XML增删改查 {public partial class Form1 : For…

创建XML和XML读到Dictionary
C#基础

创建XML和XML读到Dictionary

1791 0

namespace ListBox和XML操作 {public partial class Form1 : Form{public Form1(){InitializeComponent();}Dictionary dic = new Dictionary();private void button1_Click(object sender, EventArgs e){AddData();foreach (Control c in thi…

C#读xml_RSS_到TreeView
C#基础

C#读xml_RSS_到TreeView

1366 0

namespace 读xml_RSS_到TreeView {public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){XmlDocument doc = new XmlDocument();doc.Load("1.xml");XmlElement rootXml = doc.Document…

C#  两种方法创建XML文件
C#基础

C# 两种方法创建XML文件

5341 1

using System; using System.Collections.Generic; using System.Windows.Forms; using System.Xml; using System.Xml.Linq;namespace XML文件创建 {public partial class Form1 : Form{public Form1(){InitializeComponent();}List<Penson> list = new List<Penson&…

C#扩展方法应用实例
C#基础

C#扩展方法应用实例

1455 0

扩展方法是在不改动原来类的基础上添加方法一般尽量少用namespace 扩展方法 {class Program{static void Main(string[] args){person p = new person();p.name = "lqwvje";p.SaiHello("罗分明");//这是在不改动原来类上添加一扩展方法//注意扩展方法一定是…

C# 多播委托
C#基础

C# 多播委托

1617 0

static void Main(string[] args){Action action = M1;action += M2;action += M3;//添加方法,这样调用一下action 就会执行M1 M2 M3action -= M2;//把第M2方法去掉action("罗分明");Console.ReadKey();}static void M1(string msg){Console.WriteLine(msg);}static …

读xml文件到dataTable,dataTable保存到XML文件里面
C#基础

读xml文件到dataTable,dataTable保存到XML文件里面

1420 0

2018-11-21修改 添加演示图 及JH.xml文件 2018-03-04修改 先看一下演示以下是核心代码DataSet ds = new DataSet();private void ReadXml(){//转载请保留原创地址 http://www.luofenming.com/show.aspx?id=ART2017071200001//AppDomain.CurrentDomain.BaseDirectory为应用程序…

C#,Lambda表达式实例
C#基础

C#,Lambda表达式实例

3171 1

下面是三个在wimform 下的三个Lambda表达式实例public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){//lambda表达式调用//md();//md2("单参数Lambda表达式");int count= md3(10, 20,…