当前位置: 首页 > news >正文

网页设计个人总结/唐山seo排名优化

网页设计个人总结,唐山seo排名优化,ppt那个网站做的好,嘉兴优化网站公司原文发布时间为:2009-09-30 —— 来源于本人的百度文章 [由搬家工具导入]一提到Ashx文件,我们就会想到http handler以及图片加载(在之前我们一般使用ASPX或者Webservice去做),一般做法如下:Handler.ashx:using System;…

原文发布时间为:2009-09-30 —— 来源于本人的百度文章 [由搬家工具导入]

一提到Ashx文件,我们就会想到http handler以及图片加载(在之前我们一般使用ASPX或者Webservice去做),一般做法如下:

Handler.ashx:

using System;

using System.IO;

using System.Web;

public class Handler : IHttpHandler {

public bool IsReusable {

get {

return true;

}

}

public void ProcessRequest (HttpContext context) {

context.Response.ContentType = "image/jpeg";

context.Response.Cache.SetCacheability(HttpCacheability.Public);

context.Response.BufferOutput = false;

PhotoSize size;

switch (context.Request.QueryString["Size"]) {

case "S":

size = PhotoSize.Small;

break;

case "M":

size = PhotoSize.Medium;

break;

case "L":

size = PhotoSize.Large;

break;

default:

size = PhotoSize.Original;

break;

}

Int32 id = -1;

Stream stream = null;

if (context.Request.QueryString["PhotoID"] != null && context.Request.QueryString["PhotoID"] != "") {

id = Convert.ToInt32(context.Request.QueryString["PhotoID"]);

stream = PhotoManager.GetPhoto(id, size);

} else {

id = Convert.ToInt32(context.Request.QueryString["AlbumID"]);

stream = PhotoManager.GetFirstPhoto(id, size);

}

if (stream == null) stream = PhotoManager.GetPhoto(size);

const int buffersize = 1024 * 16;

byte[] buffer = new byte[buffersize];

int count = stream.Read(buffer, 0, buffersize);

while (count > 0) {

context.Response.OutputStream.Write(buffer, 0, count);

count = stream.Read(buffer, 0, buffersize);

}

}

}

*.aspx:

还可以嵌入文字:

Handler.ashx:

using System;

using System.Web;

public class TestHandler : IHttpHandler {

public void ProcessRequest (HttpContext context) {

context.Response.ContentType = "text/plain";

context.Response.Write("document.write(\"Hello World\");");

}

public bool IsReusable {

get {

return false;

}

}

}

*.aspx:

我们变通以下,发现其实除了可以输出图片以外,还可以输出文字:

Handler.ashx:

using System;

using System.Web;

public class Handler : IHttpHandler {

public void ProcessRequest (HttpContext context) {

context.Response.ContentType = "text/plain";

context.Response.Write("alert('hi')");

}

public bool IsReusable {

get {

return false;

}

}

}

*.aspx:

弹出alert

也可以把.ashx当成css文件

xml文件

orderDoc.load("Handler.ashx");

当你希望从ashx或HttpHandler里访问你的Session时,你必须实现IReadOnlySessionState接口.

代码:

using System;

using System.Web;

using System.Web.SessionState;

public class DownloadHandler : IHttpHandler, IReadOnlySessionState

{

public bool IsReusable { get { return true; } }

public void ProcessRequest(HttpContext ctx)

{

ctx.Response.Write(ctx.Session["fred"]);

}

}

其实,学习的思路不应该这样,以上除了图片外,我们都用偏了,为什么用偏了呢,因为软件以简单、实用为主,我们只是把以上纯粹看成可一项技术而没有把它放到软件的地位去考虑:)

具体的用途,大家可以参考Rewirte.dll (这个dll,可以使服务器支持伪静态的)!

反编译,看看人家做的:)

http://www.jmfq.cn/news/5123755.html

相关文章:

  • 口碑好的网站建设公司哪家好/搜索引擎有哪些网站
  • 宿迁网站建设价格低/盐城seo网站优化软件
  • 建设图片展示网站/武汉网络关键词排名
  • 税务局网站怎么做财务报表/浙江百度推广
  • 淘宝客做自己的网站/南宁整合推广公司
  • 嘉兴 做企业网站/优化大师手机版
  • 科技建站网站源码/百度提交入口的网址
  • 网站做百度排名/合肥建站公司seo
  • 烟台 网站建设多少钱/百度广告收费
  • 网页版qq安全中心登录入口/seo优化百度技术排名教程
  • wordpress 娱乐插件/seo提升排名
  • 做音箱木工网站/网络推广是做什么工作
  • 电商网站推荐/seo系统培训班
  • 医生在网站上做自我宣传/百度推广官网电话
  • 北海市网站建设/上海关键词seo
  • 做装修有什么好网站可以做/谷歌搜索引擎入口2023
  • 三维家设计官网/深圳网站优化公司
  • 做网站分类链接/全国免费发布信息平台
  • 网站建设怎么做/安徽网络推广和优化
  • 苏州住房与城乡建设部网站/东莞网络推广招聘
  • php网站开发实战教程/优化软件刷排名seo
  • logopond设计网站/保定seo推广外包
  • 西安有哪些网站建设公司/网络营销的应用
  • 网站建设包括什么/网站代发外链
  • 杭州市做外贸网站的公司/网店培训机构
  • 做网站前台用什么问题/网站seo 工具
  • thinkphp2.1网站挂文件/网上做广告怎么收费
  • 最新电大网站开发维护/百度seo技术
  • 学校网站如何做/百度系app有哪些
  • wordpress权限说明/优化网站排名需要多少钱