C#文件监控对象FileSystemWatcher实例,文件创建,修改,删除,重命名等

using System;using System.IO;namespace QueueSample{ class Program { static void Main(string[] args) { MyFileSystemWather myWather = new MyFileSystemWather(@"C: …… 阅读全文

C#对图片进行马赛克处理,可控制模糊程度

using System.Drawing;using System.Drawing.Imaging;using System.Web.Mvc;namespace MVC2017_Sample.Controllers{ public class DefaultController : Controller { public ActionResult Inde …… 阅读全文

MVC使用Newtonsoft无需实体类,实现JSON数据返回给前端页面使用

//引用using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult JsonSample() { ResponseResult obj = new ResponseResult(); try { …… 阅读全文

C#使用Linq To XML读取XML,Linq生成XML,Linq创建带属性或带节点XML

using System;using System.Xml.Linq;namespace Sample2{ class Program { static void Main(string[] args) { #region 写文件一(生成节点性质的) XDocument xdoc = new X …… 阅读全文

C#利用WinRAR实现压缩和解压缩

using System;using Microsoft.Win32;using System.Diagnostics;using System.IO;namespace MSCL{ /// /// 压缩解压类 /// public class ZipHelper { /// /// 利用 WinRAR 进行 …… 阅读全文

WebClient和HttpWebRequst区别

WebClient和HttpWebRequst是用来获取数据的2种方式,一般而言,WebClient更倾向于“按需下载”,事实上掌握它也是相对容易的,而HttpWebRequst则允许你设置请求头或者对内容需要更多的控制,后者有点类似于form中的submit。虽然两者都是异步请求事件,但是WebClient是基于事件的异步,而HttpWebRequst是基于代理的异步编程WebClient封 …… 阅读全文