随笔分类 -  C#.Net & MVC

摘要:System.Diagnostics.Debug.WriteLine(format, args); 阅读全文
posted @ 2019-10-28 10:33 深南大道 阅读(9331) 评论(0) 推荐(1) 编辑
摘要:/// /// 将 Stream 转成 byte[] /// /// /// public static byte[] StreamToBytes(Stream stream) { byte[] bytes = new byte[stream.Length]; stream.Read(bytes, 0, bytes.Length); // 设置当前流的位置为流的... 阅读全文
posted @ 2019-10-23 09:50 深南大道 阅读(485) 评论(0) 推荐(1) 编辑
摘要:/// <summary> /// 读取配置文件信息 /// </summary> public class ConfigExtensions { public static IConfiguration Configuration { get; set; } static ConfigExtensions() { Configuration = new ConfigurationBuilder( 阅读全文
posted @ 2019-10-22 18:19 深南大道 阅读(698) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Reflection; namespace ConsoleApp2 { class Program { static void Main(string[] args) { //反射获取 命名空间+类名 string className = "Co... 阅读全文
posted @ 2018-02-26 18:17 深南大道 阅读(13247) 评论(0) 推荐(0) 编辑
摘要:using System; using Microsoft.Win32; using System.Diagnostics; using System.IO; namespace MSCL { /// /// 压缩解压类 /// public class ZipHelper { /// /// 利用 WinRAR 进... 阅读全文
posted @ 2017-10-16 15:53 深南大道 阅读(6443) 评论(2) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using System.Data; using S... 阅读全文
posted @ 2017-10-16 14:09 深南大道 阅读(20623) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Linq; using System.Xml.Linq; namespace Sample2 { class Program { static void Main(string[] args) { #region 写文件一(生成节点性质的) XD... 阅读全文
posted @ 2017-10-16 14:05 深南大道 阅读(9243) 评论(1) 推荐(0) 编辑
摘要://引用using Newtonsoft.Json; using Newtonsoft.Json.Linq; public ActionResult JsonSample() { ResponseResult obj = new ResponseResult(); try { JObject jo 阅读全文
posted @ 2017-10-16 10:12 深南大道 阅读(1417) 评论(0) 推荐(0) 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace Sample3 { class Program { static... 阅读全文
posted @ 2017-10-16 09:34 深南大道 阅读(13496) 评论(2) 推荐(1) 编辑
摘要:uploadify3.2上传文件 using System; using System.Collections.Generic; using Sys... 阅读全文
posted @ 2017-10-14 20:28 深南大道 阅读(3107) 评论(0) 推荐(0) 编辑
摘要:/// /// 反射得到实体类的字段名称和值 /// var dict = GetProperties(model); /// /// 实体类 /// 实例化 /// public static Dictionary GetProperties(T t) { var ret = new Dictionary(); if (t == null) { return null; ... 阅读全文
posted @ 2017-10-14 20:26 深南大道 阅读(8614) 评论(1) 推荐(0) 编辑
摘要:/*查找XML*/ var filePath = Server.MapPath("~/xml/sample.xml"); XDocument doc = XDocument.Load(filePath); var text1 = doc.Descendants("用户") //定位到节点 .Where(p => p.Element("性别").Value.Co... 阅读全文
posted @ 2017-10-14 20:24 深南大道 阅读(5565) 评论(0) 推荐(0) 编辑
摘要:MSCL超强工具类库 是基于C#开发的超强工具类集合,涵盖了日常B/S或C/S开发的诸多方面,包含上百个常用封装类(数据库操作类全面支持Mysql、Access、Oracle、Sqlserver、Sqlite等数据库,常用字符串处理类,内存容器类,Session/Cookie/Cache类,Conf 阅读全文
posted @ 2017-10-14 20:12 深南大道 编辑
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Configuration; using System.Data.SqlClient; using System.Data; using S... 阅读全文
posted @ 2017-10-14 13:45 深南大道 阅读(1645) 评论(0) 推荐(1) 编辑
摘要:@{ Layout = null; } 示例 public ActionResult Sample() { List list = new List() { new SampleData{ id=1000, name="张三", sex="男"}, new Sam... 阅读全文
posted @ 2017-10-14 11:32 深南大道 阅读(1812) 评论(0) 推荐(0) 编辑
摘要:using Quartz; using Quartz.Impl; using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Text; using System.Threading; using System.Threading.Tasks; ... 阅读全文
posted @ 2017-10-14 11:31 深南大道 阅读(1910) 评论(0) 推荐(0) 编辑
摘要://App_Start-RouteConfig.cs public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo... 阅读全文
posted @ 2017-10-14 11:29 深南大道 阅读(949) 评论(0) 推荐(0) 编辑
摘要:using System.Drawing; using System.Drawing.Imaging; using System.Web.Mvc; namespace MVC2017_Sample.Controllers { public class DefaultController : Cont 阅读全文
posted @ 2017-10-14 10:00 深南大道 阅读(2205) 评论(0) 推荐(0) 编辑
摘要:为什么使用时间戳? 关于Unix时间戳,大概是这个意思,从1970年0时0分0秒开始到现在的秒数.使用它来获得的是一个INT值,储存在数据库里只要使用INT格式就可以了,方便数据库进行排序,搜索,而且比datetime格式更节省数据库空间。 阅读全文
posted @ 2016-12-19 10:54 深南大道 阅读(9431) 评论(0) 推荐(0) 编辑
摘要:/*查找XML*/ var filePath = Server.MapPath("~/xml/sample.xml"); XDocument doc = XDocument.Load(filePath); var text1 = doc.Descendants("用户") //定位到节点 .Where(p => p.Element("性别").Value.Contains('男')) ... 阅读全文
posted @ 2016-12-17 17:30 深南大道 阅读(187) 评论(0) 推荐(0) 编辑