上一页 1 ··· 96 97 98 99 100 101 102 103 104 ··· 164 下一页
摘要: HTML生成PDF(c#)Calling wkhtmltopdf to generate PDF from HTML老外最多人加分的那篇做法,使用wkhtmtopdf(GPL协议)可以省很多程序代码, 首先到官网http://code.google.com/p/wkhtmltopdf/downloads/list找installer.exe下载wkhtmltopdf,一个集成好了的exe文件(C++编写),基本的调用方法是, wkhtmltopdf.exehttp://passport.yupsky.com/account/register e:\yupskyreg.pdf,可以先在命令行测试 阅读全文
posted @ 2012-12-27 09:28 火腿骑士 阅读(271) 评论(0) 推荐(0)
摘要: 在Asp.net MVC controller的底层,常常有提到repository和service layer, 好像都是逻辑相关的层,那么它们到底是什么区别呢?简单的说:repository就是一个管理数据持久层的,它负责数据的CRUD(Create, Read, Update, Delete)service layer是业务逻辑层,它常常需要访问repository层,但是它不关心数据是如何获取和存储的。来发现很多ASP.NET MVC的例子中都使用了Repository模式,比如Oxite,ScottGu最近发布的免费的ASP.NET MVC教程都使用了该模式。就简单看了下。在《企业架 阅读全文
posted @ 2012-12-25 18:00 火腿骑士 阅读(745) 评论(0) 推荐(0)
摘要: 在上篇文章中和大家一起学习了建立基本的WebAPI应用,立刻就有人想到了一些问题:1.客户端和WebService之间文件传输2.客户端或者服务端的安全控制要解决这些问题,要了解一下WebAPI的基本工作方式。(一)WebAPI中工作的Class在MVC中大家都知道,获取Request和Response使用HttpRequest和HttpResponse两个类,在WebAPI中使用两外两个类:HttpRequestMessage 和HttpResponseMessage,分别用于封装Requset和Response。除了这两个类之外,还有一个常见的抽象类:HttpMessageHandler, 阅读全文
posted @ 2012-12-17 22:38 火腿骑士 阅读(301) 评论(0) 推荐(0)
摘要: http://stackoverflow.com/questions/10660721/what-is-the-difference-between-httpresponsemessage-and-httpresponseexception 阅读全文
posted @ 2012-12-17 22:31 火腿骑士 阅读(124) 评论(0) 推荐(0)
摘要: http://www.prideparrot.com/blog/archive/2012/8/uploading_and_returning_files 阅读全文
posted @ 2012-12-17 21:18 火腿骑士 阅读(141) 评论(0) 推荐(0)
摘要: http://stackoverflow.com/questions/10861568/asmx-web-service-basic-authentication//-----------------------------------------------------public class BasicAuthHttpModule:IHttpModule{ voidIHttpModule.Init(HttpApplication context) { context.AuthenticateRequest+=newEventHandler(OnAuthenticateRequest); } 阅读全文
posted @ 2012-12-15 20:29 火腿骑士 阅读(387) 评论(0) 推荐(0)
摘要: publicclassUserAuthenticator:IHttpModule{ publicvoidDispose() { } publicvoidInit(HttpApplication application) { application.AuthenticateRequest+=newEventHandler(this.OnAuthenticateRequest); application.EndRequest+=newEventHandler(this.OnEndRequest); } publicvoidOnAuthenticateRequest(object source,Ev 阅读全文
posted @ 2012-12-15 19:47 火腿骑士 阅读(231) 评论(0) 推荐(0)
摘要: 什么是HTTP Basic Authentication?在wiki上有详细的解释: http://en.wikipedia.org/wiki/Basic_authentication_schemeHTTP Basic Authentication是一个定义在HTTP/1.1规范中的验证机制。这种机制是以用户名和密码为基础的。一个web server要求一个web client去验证一个用户。作为request的一部分,web server 传递被称之为realm的字符串,用户就是在它里面被验证的。注意:Basic Authentication机制的realm字符串不一定反映任何一种安全方针域 阅读全文
posted @ 2012-12-15 19:42 火腿骑士 阅读(885) 评论(0) 推荐(0)
摘要: http://www.cnblogs.com/yingzi/archive/2012/03/13/2394809.htmlHTTP请求格式当浏览器向Web服务器发出请求时,它向服务器传递了一个数据块,也就是请求信息,HTTP请求信息由3部分组成:l请求方法URI协议/版本l请求头(Request Header)l请求正文下面是一个HTTP请求的例子:GET/sample.jspHTTP/1.1Accept:image/gif.image/jpeg,*/*Accept-Language:zh-cnConnection:Keep-AliveHost:localhostUser-Agent:Mozi 阅读全文
posted @ 2012-12-15 19:39 火腿骑士 阅读(1560) 评论(0) 推荐(0)
摘要: 不同于之前的HttpWebRequest类型,在.NET 4.5中新的HttpRequestHeaders类型直接有一个Authorization属性,对应类型是:AuthenticationHeaderValue,同样在System.Net.Http.Headers命名空间内。AuthenticationHeaderValue有两个属性Parameter和Scheme。为了弄清这两个参数在对Authorization属性的作用,我们可以做一个简单的测试:首先得记得加入.NET 4.5中HttpClient相应的命名空间://+ using System.Net.Http;//+ using 阅读全文
posted @ 2012-12-15 19:32 火腿骑士 阅读(368) 评论(0) 推荐(0)
上一页 1 ··· 96 97 98 99 100 101 102 103 104 ··· 164 下一页