摘要:一、EXCEL 导入(Excel 导入导出实际项目中会被封装成**Helper 本示例只对简单功能做演示) NPOI 包引用 视图view Action 命名空间引用 using NPOI.SS.UserModel;using NPOI.HSSF.UserModel;using NPOI.XSSF.
阅读全文
摘要:一、之值类型与引用类型 输出结果 10 10 11 二、之继承重写 输出结果 10 三、C# 关于base常见使用及基本理解 本类代码 public class HomeController :BaseController { [ActionTestFilter] public ActionResu
阅读全文
摘要:一、RSA加密解密 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Security.Cryptography; using System.Text; u
阅读全文
摘要:1、冒泡排序 排序 int[] ArrayList = new int[] {81,23,66,34,99,77,98 }; for (int i = 0; i < ArrayList.Count(); i++) { for (int j = i; j < ArrayList.Count(); j+
阅读全文
摘要:1、WinForm遍历控件 foreach (System.Windows.Forms.Control control in this.Controls) { if (control is System.Windows.Forms.TextBox) { System.Windows.Forms.Te
阅读全文
摘要:1、时间处理 Model.PiDaiTime.ToString("yyyyMMdd") == "00010101" ? DateTime.Now.ToString("yyyy-MM-dd") : Model.PiDaiTime.ToString("yyyy-MM-dd")
阅读全文
摘要:1、MVC返回json方式 1、(自定义返回json对象)var optionStrCity=“”;var optionStrBank =“”; return Json(new { optionStrCity = optionStrCity, optionStrBank = optionStrBan
阅读全文
摘要:1、excel文件读取 1. com组件操作excel 读写 2. ado.net方式操作excel 读写 3. 开源的第三方组件npoi 4. open xml 方式读写excel 方式一使用OleDbConnection System.Data.DataTable dt =GetExcelDat
阅读全文
摘要:1、where \sum 1、条件查询List.Where(e => e.Status == 5).ToList().Count(); List.Where(e => e.Status == 5).Sum(e => e.FangKuanMoney) 2、GroupBy、First Apply_Cus
阅读全文
摘要:1、 创建cookie /// <summary> /// 创建cookie /// </summary> /// <param name="key">键</param> /// <param name="value">值</param> public static void CreateCooki
阅读全文
摘要:引用 程序集 ChnCharInfo.dll using Microsoft.International.Converters.PinYinConverter; 转换方法 public static string ToPinyin(string hanzi) { char[] ch = hanzi.
阅读全文
摘要:一、获取IP常用方法 public class BaseAPIController : ApiController { /// <summary> 获取客户端访问IP /// </summary> protected string CurrentUserIP { get { string realR
阅读全文
摘要:1、摇奖机的实现 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; usin
阅读全文
摘要:1、委托的异步调用 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; usi
阅读全文
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Security;using System.Web.SessionState;namespace Web
阅读全文
摘要:数据库缓存依赖1、数据库缓存依赖-S服务器名称 -E集成身份验证 -ed启动 -d数据库名称 -et指定缓冲依赖的表名 -t表名在vs2010的命令提示符中运行(切换到aspnet_regsql.exe所在的目录)aspnet_regsql.exe -S 127.0.0.1 -E -ed -d my
阅读全文
摘要:1、树加载 2、邮件发送 public partial class FrmSendMail : Form { private string mail; public FrmSendMail(string mail) { this.mail = mail; InitializeComponent();
阅读全文