摘要:反射(Reflection)是.NET中的重要机制,通过放射,可以在运行时获得.NET中每一个类型(包括类、结构、委托、接口和枚举等)的成员,包括方法、属性、事件,以及构造函数等。还可以获得每个成员的名称、限定符和参数等。有了反射,即可对每一个类型了如指掌。如果获得了构造函数的信息,即可直接创建对象...
阅读全文
摘要:反射的作用想必大家都知道了吧,少量属性的自动化操作手动添加几下当然是没有问题的,但是属性数量较多的时候敲起这些繁锁的代码可以困了,再说对扩展和维护性造成很多的不遍,以下代码中如不能直接使用请添加using System.Text;的引用。要想对一个类型实例的属性或字段进行动态赋值或取值,首先得得到这...
阅读全文
摘要:public class MyEventArgs { private int _rate; public int Rate { get { return _rate; } } p...
阅读全文
摘要:static void Main(string[] args) { //DateTime dt = DateTime.Now; //RemoteObject.MyObject app = new RemoteObject.MyObject...
阅读全文
摘要:static void Main(string[] args) { //DateTime dt = DateTime.Now; //RemoteObject.MyObject app = new RemoteObject.MyObject(...
阅读全文
摘要:http://www.linuxidc.com/Linux/2014-04/100491.htm首先安装xfce:sudo apt-get updatesudo apt-get install xfce4如果网速较慢,这会持续一段时间。然后安装xrdp组件和vnc服务器:sudo apt-get i...
阅读全文
摘要:public class FtpClient { #region 构造函数 /// /// 创建FTP工具 /// /// 默认不使用SSL,使用二进制传输方式,使用被动模式 /// //...
阅读全文
摘要:using System;using System.Net;using System.IO;using System.Text;using System.Net.Sockets;using System.Collections.Generic;namespace 阿飞_秋风扫落叶网站软文系统.Com...
阅读全文
摘要:namespace System.Runtime.CompilerServices { public class ExtensionAttribute : Attribute { } } 网上找的其他方法错误产生环境及非完美解决办法错误提示:缺少编译器要求的成员“System.Ru...
阅读全文
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Window...
阅读全文
摘要:1.添加命名空间 System.IO; System.Text;2.文件的读取 (1).使用FileStream类进行文件的读取,并将它转换成char数组,然后输出。 byte[] byData = new byte[100]; char[] charData = ...
阅读全文
摘要:public class AppModify { /// /// 依据连接串名字connectionName返回数据连接字符串 /// /// /// public static string GetC...
阅读全文
摘要://这个方法是浏览文件对象 private void button1_Click(object sender, EventArgs e) { //用户打开文件浏览 using (OpenFileDialog dialog = ...
阅读全文
摘要:base.BeginInvoke((MethodInvoker)delegate() { this.newdt.Rows[e.ProgressPercentage]["Stat"] = _link.Url; ...
阅读全文
摘要:public class JsonHelper { /// /// 将对象序列化为JSON格式 /// /// 对象 /// json字符串 public static string Seriali...
阅读全文
摘要:List lc;// = new List(); private void BindGrid() { //if (lc.Count > 0) // lc.Clear(); lc = new List...
阅读全文
摘要:Newtonsoft.Json,一款.NET中开源的Json序列化和反序列化类库(下载地址http://json.codeplex.com/)。下面是Json序列化和反序列化的简单封装:/// /// Json帮助类 /// public class JsonHelper ...
阅读全文
摘要:首先是实例化的时候的参数的解释//Initialize SmartThreadPool & Make logs//SmartThreadPool m_hThreadPool;//m_hThreadPool = new SmartThreadPool();//声明一个线程池STPStartInfo s...
阅读全文