摘要: 在MVC中发送Email 可以使用WebMail ;使用起来十分简单。如下: WebMail.SmtpServer = ConfigurationHelper.GetValue("SmtpServer");//获取或设置要用于发送电子邮件的 SMTP 中继邮件服务器的名称。 W... 阅读全文
posted @ 2015-11-19 01:07 nele 阅读(487) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Text;using System.Security.Cryptography;using System.IO;namespace Csharp{ class AESHelpe... 阅读全文
posted @ 2015-11-19 00:24 nele 阅读(8430) 评论(1) 推荐(0)
摘要: 个人目测Request.IsAjaxRequest()这个东西是判断前台提交过来的header中的X-Requested-With:XMLHttpRequest来区分是不是ajax请求的。ASP.NET MVC3 中我们可以在"_ViewStart.cshtml"中指定 Layout为我们定义的"_... 阅读全文
posted @ 2015-11-18 16:04 nele 阅读(4946) 评论(0) 推荐(2)
摘要: volatile 影响编译器编译的结果,指出,volatile 变量是随时可能发生变化的,与volatile变量有关的运算,不要进行编译优化,以免出错,(VC++ 在产生release版可执行码时会进行编译优化,加volatile关键字的变量有关的运算,将不进行编译优化。)。例如:volatile ... 阅读全文
posted @ 2015-11-18 12:37 nele 阅读(2629) 评论(0) 推荐(0)
摘要: (1).实现功能:通过前台选择.xlsx文件的Excel,将其文件转化为DataTable和List集合(2).开发环境:Window7旗舰版+vs2013+Mvc4.0(2).在使用中需要用到的包和dll 1.用NuGet引入OpenXML包【全名叫DocumentFormat.OpenXml】... 阅读全文
posted @ 2015-11-16 21:14 nele 阅读(580) 评论(0) 推荐(0)
摘要: 每个C#函数都允许有个参数带params关键字,在调用的时候可以不给他传值,也可以给他传值,还可以给他传多个值,例子如下:using System;using System.Collections.Generic;using System.Text;namespace ConsoleApplicat... 阅读全文
posted @ 2015-11-14 10:54 nele 阅读(299) 评论(0) 推荐(0)
摘要: http://www.cnblogs.com/powertoolsteam/p/top15features.html目录1. ObsoleteAttribute2. 设置默认值属性: DefaultValueAttribute3. DebuggerBrowsableAttribute4. ??运算符... 阅读全文
posted @ 2015-11-13 09:45 nele 阅读(308) 评论(0) 推荐(0)
摘要: 先贴上代码 [HttpPost] public IActionResult ImportTeaching(IFormFile file) { string root = @"Temp/teachingfile/"; strin... 阅读全文
posted @ 2015-11-07 13:35 nele 阅读(868) 评论(0) 推荐(0)
摘要: (此文章同时发表在本人微信公众号“dotNET每日精华文章”,欢迎右边二维码来关注。)题记:在ASP.NET 5(MVC 6)中处理上传文件的方式和之前有所不同。在MVC 5之前的版本中上传文件,有两种方式。1,直接对Request.Files进行访问获取HttpPostedFileBase,如下面... 阅读全文
posted @ 2015-11-07 12:57 nele 阅读(896) 评论(0) 推荐(0)
摘要: //using System;//using System.Collections.Generic;//using System.Text;//namespace 索引//{// class Program// {// static void Main(string[] args)// {// }/... 阅读全文
posted @ 2015-11-03 23:22 nele 阅读(701) 评论(0) 推荐(0)