随笔分类 - C#学习
C# 序列化和反序列化
摘要:///<summary> /// 序列化 /// </summary> /// <param name="data">要序列化的对象</param> /// <returns>返回存放序列化后的数据缓冲区</returns> public static byte[] Serialize(object
阅读全文
C#中哈希表(HashTable)的用法详解以及和Dictionary比较
摘要:1. 哈希表(HashTable)简述 在.NET Framework中,Hashtable是System.Collections命名空间提供的一个容器,用于处理和表现类似keyvalue的键值对,其中key通常可用来快速查找,同时key是区分大小写;value用于存储对应于key的值。Hashta
阅读全文
c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Exit(0);
摘要:本文实例总结了C#中WinForm程序退出方法技巧。分享给大家供大家参考。具体分析如下: 在c#中退出WinForm程序包括有很多方法,如:this.Close(); Application.Exit();Application.ExitThread(); System.Environment.Ex
阅读全文
C#获取CPU占用率、内存占用、磁盘占用、进程信息
摘要:using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using System.IO; using System.Text; using System.Man
阅读全文
C#中Image , Bitmap 和 BitmapData
摘要:先说Image,Image 就是个图像,不能实例化,提供了位图和源文件操作的函数。本篇文章他就是来打酱油的,这里提供一个Bitmap转成BitmapSource的方法。 接下来说Bitmap和BitmapData。 Bitmap类Bitmap对象封装了GDI+中的一个位图,此位图由图形图像及其属性的
阅读全文
C#操作XML方法详解
摘要:using System.Xml; //初始化一个xml实例 XmlDocument xml=new XmlDocument(); //导入指定xml文件 xml.Load(path); xml.Load(HttpContext.Current.Server.MapPath("~/file/book
阅读全文
C# Activator和new的区别
摘要:1、你需要动态的创建一个实例模型的时候,就用Activator.CreateInstance(Type type);如果是明确的知道要创建哪个实例的模型,就可以用 new Class1()了。 T tInstance= (T)Activator.CreateInstance(typeof(T), n
阅读全文
WPF与WinForm开发有什么区别?
摘要:转自http://hi.baidu.com/leoliu83/blog/item/1d1a4a66dcb41134aa184cfd.html WPF与WinForm开发有什么区别? 2010-11-06 21:43 WPF开发于WinForm之后,从技术发展的角度,WPF比WinForm先进是不容置
阅读全文
NuGet的简单使用
摘要:什么是NuGet? NuGet(读作New Get)是用于微软.NET开发平台的软件包管理器,是一个Visual Studio的扩展。在使用Visual Studio开发基于.NET Framework的应用时,NuGet能够令你在项目中添加、移除和更新引用的工作变得更加快捷方便。通过NuGet你可
阅读全文
键值对Dictionary、KeyValuePair、Hashtable 简单使用。
摘要:KeyValuePair是单个的键值对对象。KeyValuePair可用于接收combox选定的值。 例如:KeyValuePair<string, object> par = (KeyValuePair<string, object>)shoplistcomboBox.SelectedItem;
阅读全文
浙公网安备 33010602011771号