摘要:
有一个项目用到Excel组件产生报表,本以为这个通用功能是个很简单的case,没想到结果却花了不少时间本人开发环境:Win7 64bit + IIS7.5 + VS2012最开始碰到的问题是NetworkService无法访问com组件,需要对帐户进行授权,这个相信很多人都碰到过,也很好解决1.运行:mmc comexp.msc /32,找到我的电脑 -> DCom配置中的Microsoft Excel Application2.在Microsoft Excel Application上点击右键,选择"属性"3.点击"标识"标签,选择"交 阅读全文
摘要:
代码如下:View Code 1 (function($){ 2 var $window = $(window); 3 4 function createFixedCss(name, top) { 5 var doc = document, 6 heads = doc.getElementsByTagName("head"), 7 style = doc.createElement("style"), 8 cssText = "." + name + "{ position: fixed... 阅读全文
摘要:
在web开发中,经常会碰到数据已经在页面中显示,但又要下载Excel格式的报表的情形显示在服务器重新计算一次比较耗时,这些一般会把页面上的数据post到服务器,服务器产生二进制的excel响应流然后发送给服务器端1.方法一:<form id="form2" action="/download.ashx" method="post" target="_self"><input name="id" type="hidden" value="1" 阅读全文
摘要:
1.配置文件:<system.data> <DbProviderFactories> <remove invariant="System.Data.SQLite" /> <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLite 阅读全文
摘要:
1.抽象属性基类 1 [AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] 2 public abstract class AspectAttribute : Attribute 3 { 4 public Type CallHandlerType { get; protected set; } 5 6 protected abstract PropertyInfo[] PropertiesInfo { get; } 7 8 public NameValueCollection GetAttrs... 阅读全文
摘要:
1.下载 ILSpy Visual Studio Plugin 并安装http://community.sharpdevelop.net/forums/p/13720/36781.aspx2.下载 ILSpy2.0:http://wiki.sharpdevelop.net/ILSpy.ashx3.将C:\Program Files (x86)\SourceFly\ILSpy的文件删除,把上面下载的ILSpy2.0文件解压缩后复制到此目录4.重新打开Visual Studio, 鼠标选定你需要查看的Assmbly方法,在右键菜单中点击Browse Source即可5.可以设置快捷键,参考ILSp 阅读全文
摘要:
1.安装ASP.NET Ajax1.0 点击安装2.在Web项目中添加引用:System.Web.Extensions(Version:1.0.61025.0)3.更改web.config,在<system.web>节点加入子节点: <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToke 阅读全文
摘要:
插入实体的字段:var data = new Comments();data.ArticleId = 1;data.AuditStatus = 2;data.Company = 5;data.Content = "测试";data.CreateTime = DateTime.Now;data.IP = "192.168.1.2";data.NickName = "张三";data.ReplyContent = string.Empty;data.ReplyId = 0;data.ReplyNickName = string.Empty 阅读全文
摘要:
int[] source = { 5, -3, 6, -7, -6, 1, 8, -4, 0, 0 };int toRightIdx = 0;int toLeftIdx = source.Length - 1;int leftIdx = 0;int rightIdx = source.Length - 1;int[] result = new int[source.Length];while (true){ if (toLeftIdx >= 0) { int left = source[toRightIdx++]; if (left < 0) resul... 阅读全文
摘要:
1.服务器端代码: /// <summary> /// 自定义Ext Ajax请求结果 /// </summary> /// <param name="success">是否成功</param> /// <param name="value">结果</param> /// <returns></returns> protected ActionResult ExtJson(bool success) { return ExtJson(success, 0, s 阅读全文