2014年1月15日

摘要: 首先推荐一个神作:http://www.cnblogs.com/daniel206/archive/2008/01/16/1041748.html大神比较详细了。而且条理很清晰。然后摘录一些其他的,补充一下上文。select * from OPENDATASOURCE( 'SQLOLEDB', 'Data Source=远程ip;User ID=sa;Password=密码' ).库名.dbo.表名 insert 本地库名..表名 select * from OPENDATASOURCE( 'SQLOLEDB', 'Data Source 阅读全文
posted @ 2014-01-15 11:11 未来证明现在 阅读(191) 评论(0) 推荐(0) 编辑

2013年12月25日

摘要: 这里贴一段验证码的代码,只做记录,方便直接使用。using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Drawing;using System.IO;using System.Drawing.Imaging;namespace Elink.Web.Authencation.CheckCode{ public partial class SafeCode ... 阅读全文
posted @ 2013-12-25 15:33 未来证明现在 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 这里贴下代码吧,没啥好说的。using System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.Office.Core;using Microsoft.Office;usi... 阅读全文
posted @ 2013-12-25 15:30 未来证明现在 阅读(395) 评论(1) 推荐(0) 编辑
摘要: 把页面导出生成pdf,这里用到第三方的工具,使用方法中文文档没有找到,网上也没找到网友详细的神作。没有深入研究,所以也不赘述了,当然最基本的使用大多数也够用了,详细参数的官网也没介绍,大家使用的时候,可以通过命令行来查看参数帮助 wkhtmltopdf.exe--help简单使用,不说了,贴代码。/... 阅读全文
posted @ 2013-12-25 15:11 未来证明现在 阅读(5726) 评论(0) 推荐(0) 编辑
摘要: 遇到需要导出页面到pdf,并添加pdf水印的业务。稍微研究了下,借阅网友的前车之鉴,经过使用可行之后的代码贴出来,做个记录,也供需要的网友借阅。public class PDFSetWaterMark { /// /// 创建一个显示指定图片的pdf ... 阅读全文
posted @ 2013-12-25 14:54 未来证明现在 阅读(12223) 评论(2) 推荐(0) 编辑

2013年12月24日

摘要: 用iTextSharp做pdf转换的时候,需要添加水印。文字水印的时候,需要设置字体,查了下文档。摘录下解决方案。iText中输出中文,有三种方式:1、使用iTextAsian.jar中的字体 BaseFont.createFont("STSong-Light", "UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);2、使用Windows系统字体(TrueType)BaseFont.createFont("C:/WINDOWS/Fonts/SIMYOU.TTF", BaseFont.IDENTITY_H,Bas 阅读全文
posted @ 2013-12-24 11:46 未来证明现在 阅读(6316) 评论(0) 推荐(0) 编辑

2013年12月23日

摘要: 异常:System.ObjectDisposedException: Cannot access a closed file.错误指向:读取流的内容语句 stream.Read(byteArr, 0, byteArr.Length);当然,这里没有使用流来操作上传文件的,使用HttpContext.Request.Files[i].SaveAs(),也会出现这个问题。解决方案同下。/// /// 文件上传 /// /// 上传的文件流 /// 上传文件的保存路径 /// 错误信息 /// ... 阅读全文
posted @ 2013-12-23 16:59 未来证明现在 阅读(1830) 评论(0) 推荐(0) 编辑

2012年3月22日

摘要: 两种封装方法:View Code #region 发送Http请求,获取返回结果 /// <summary> /// 发送http请求,获取响应( Send HttpRequest and Get HttpResponse) /// </summary> /// <param name="RequestUrl">请求地址</param> /// <param name="Params">http请求参数</param> /// <returns>响应内容</retu 阅读全文
posted @ 2012-03-22 17:18 未来证明现在 阅读(865) 评论(0) 推荐(0) 编辑
摘要: 简单的东东,网上参考借鉴的,什么也不说了,上代码。View Code using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;using System.Text;public partial class GetPrintContent : System.Web.UI.Page{ protected string ClientCode = string.Empty; prote... 阅读全文
posted @ 2012-03-22 16:59 未来证明现在 阅读(1219) 评论(6) 推荐(0) 编辑
摘要: 以下代码补充,客户端web网页导入数据到sql 数据库时,涉及到的文件上传小知识。这里使用了web服务器文件上传控件,有些赘述,代码不够简洁,见谅。View Code 1 private void subInsert() 2 { 3 string Message = string.Empty; 4 string WebFilePath = string.Empty; 5 string LocalFilePath = string.Empty; 6 if (!string.IsNullOrEmpty(this.UpFile... 阅读全文
posted @ 2012-03-22 15:39 未来证明现在 阅读(2381) 评论(2) 推荐(0) 编辑

导航