常见.NET功能代码汇总 (3)】的更多相关文章

常见.NET功能代码汇总 23,获取和设置分级缓存 获取缓存:首先从本地缓存获取,如果没有,再去读取分布式缓存写缓存:同时写本地缓存和分布式缓存 private static T GetGradeCache<T>(string key) where T:struct { MemoryCacheManager localCache = MemoryCacheManager.Instance; if (!localCache.IsSet(key)) { //本地不存在此缓存 T remoteVal…
1,在Web上修改指定文件位置的Web.config 这里需要使用 WebConfigurationManager 类,但必须使用WebConfigurationFileMap类来指定文件位置,看代码: ; //修改网站的配置文件 var configFile = new FileInfo(configFilePath); var vdm = new VirtualDirectoryMapping(configFile.DirectoryName, true, configFile.Name);…
33,彻底关闭Excel进程 .NET中使用Excel属于使用非托管资源,使用完成后一般都要用GC回收资源,但是,调用GC的位置不正确,Excel进程可能无法彻底关闭,如下面的代码: static void OpenExcelTest(int j) { //Application excel = null; excel = new Application(); excel.Visible = true; excel.Workbooks.Open("d:\\A1000.xla"); Wo…
多文件上传 http://smotive.iteye.com/blog/1903606 java 常用代码 Struts2 前后台(Action ,jsp)传值.取值 Action public List<Jyj_party_Entity> partyList; public List<Jyj_party_Entity> getPartyList() {       return partyList;   } public void setPartyList(List<Jyj…
弹窗代码汇总 [0.超完美弹窗代码] 功能:5小时弹一次+背后弹出+自动适应不同分辩率+准全屏显示 代码: <script> function openwin(){ window.open(http://www.6882.com,"pop1","width="+(window.screen.width-15)+",height="+(window.screen.height-170)+",left=0,top=0,toolb…
leetcode刷题之后,很多问题老是记忆不深刻,因此特意开此帖: 一.对做过题目的总结: 二.对一些方法精妙未能领会透彻的代码汇总,进行时常学习: 三.总结面试笔试常见题目,并讨论最优解法及各种解法的优劣: leetcode探索中级算法 1)排序相关   快排,归并,堆排,插入,选择   1.1)基础算法原理与实现:   十大排序算法:C++   1.2) 直接使用排序算法的题目: leetcode 628. 三个数的最大乘积 1.3)通过归并排序求逆序数: 微软面试题:求一个序列的逆序对数(…
html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Con…
Magento Table Rate是三种内置未调用第三方API运费方式中最强大的一个.通过设置国家,区域,邮编,价格来划分不同的运费等级.该方式基本能够满足轻量级的B2C商城的运费模式.这里收集下国家代码,作为备用. AF – AfghanistanAL – AlbaniaDZ – AlgeriaAS – American SamoaAD – AndorraAO – AngolaAI – AnguillaAQ – AntarcticaAG – Antigua and BarbudaAR – A…
通过javascript库JQuery实现页面跳转功能代码的四段代码实例如下. 实例1: 1 2 3 4 $(function(){ var pn = $("#gotopagenum").val();//#gotopagenum是文本框的id属性 location.href = "NewList.aspx?pagenum="+pn;//location.href实现客户端页面的跳转 }); 实例2: 实现跳转:window.location = 'user!add.…
矩阵分解(rank decomposition)文章代码汇总 矩阵分解(rank decomposition) 本文收集了现有矩阵分解的几乎所有算法和应用,原文链接:https://sites.google.com/site/igorcarron2/matrixfactorizations Matrix Decompositions has a long history and generally centers around a set of known factorizations such…