asp.netÍøÒ³¾²Ì¬»¯
Ò»¡£¢Ù£ºÊ×ÏÈÒªÓÐÕâ¸öÎļþURLRewriter.dll,Èç¹ûûÓÐ,¸Ï¿ìµ½ÍøÉÏÏÂÔØÒ»¸ö,²¢½«Æä·Åµ½ÏÂÃæµÄbinĿ¼ÀïÃæ,²¢ÇÒ½«ÆäÒýÓÃÌí¼Óµ½ÏÂÃæÀïÃæ;
¢Ú£ºÏÂÃæ¾ÍÊÇWeb.ConfigÎļþµÄÅäÖÃÁË,µ±È»,ÅäÖùý³ÌÏ൱¼òµ¥£º
1£ºÏÈÌí¼ÓÕâ¸ö
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
</configSections>
<RewriterConfig>
<Rules>
<!-- Rules for Blog Content Displayer -->
<RewriterRule>
<LookFor>~/(.[0-9]*)\.html</LookFor>
<SendTo>~/ArticleDetail.aspx?MyID=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
2£ºÔÙÌí¼ÓÕâ¸ö
<httpHandlers>
<add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
<add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
</httpHandlers>
ÖÁ´Ë,Òѳɹ¦Ò»´ó°ë,ÉÏÃæÁ½¸ö¶¼Ìí¼Óµ½Web.Config,Ìí¼Óµ½Ê²Ã´Î»Öÿ´À´Ã»±ØÒª½²ÁË£¡
×îºóÒ»²½£ºÔÚIISÖÐÕÒµ½×Ô¼ºµÄÐéÄâĿ¼ÍøÕ¾,µãÊôÐÔ,È»ºóµãÅäÖÃ,È»ºóµ¯³öÓ¦ÓóÌÐòÅäÖöԻ°¿ò,Ñ¡ÔñÌí¼Ó,Ìí¼ÓµÄ¿ÉÖ´ÐÐÎļþ·¾¶Îªc:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll,À©Õ¹ÃûΪ.html£¨Èç¹ûÊÇÐéÄâÖ÷»ú£¬¿É¹ºÂòʹÓþÅÍø»¥ÁªµÄÖ÷»ú£¬¿ÉÖ±½ÓÔÚÏß²Ù×÷¿ªÍ¨Î±¾²Ì¬
¶þ¡£
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
namespace Web.Admin
{
public partial class Admin_MakeIndex : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
CommFun.IsAdmin();
if (!IsPostBack)
{
string url = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.LastIndexOf("/admin"))
Ïà¹ØÎĵµ£º
ÏÂÃæÊÇдcookie
1 HttpCookie cookie = new HttpCookie("Info");//¶¨Òåcookie¶ÔÏóÒÔ¼°ÃûΪInfoµÄÏî
2 DateTime dt = DateTime.Now;//¶¨Òåʱ¼ä¶ÔÏó
3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookieÓÐЧ×÷ÓÃʱ¼ä£¬¾ßÌå²émsdn
4 cookie.Expires = dt.Add(ts);//Ìí¼Ó×÷ÓÃʱ¼ä
5 cookie.Values.Add("user","cxbkkk");//Ôö¼ ......
ÔÚasp.netÖе¼³öexcel ÖбȽÏͨÐеÄ×ö·¨ÊÇ: Response.ContentType = "application/vnd.ms-excel";
È»ºóÖ±½ÓÏòÀïÃæÈÓ html µÄtable
µ«ÊÇÓÐÖÐÎĵÄʱºò ÀϳöÏÖÂÒÂ룬Óкܶà½â¾ö·½°¸£¬µ«¶¼²»ÄÜͨÅ̽â¾ö, ¾ÍÊÇÔÚ Êä³öhtmlÁ½Í·Êä³ö
Response.Write("<html><head><meta http-equiv=Content-Type conte ......
֮ǰҪÍê³ÉÒ»¸öÖ§³Ö¶àÖ§³Ö¶àÖÖ¸ñʽµÄÊÓƵ²¥·ÅÆ÷£¬ÔÚÍøÉÏÕÒµ½Ò»¸öVBдµÄ£¬È»ºó¸Ä³ÉC#£¬½ü¶ÎÔÚÍøÉÏÒ²¼ûÓв»ÉÙÈËÎÊÕâ¸öÎÊ£¬ÔÚ´Ë·ÖÏí
public class VideoPlayer
{
/// <summary>
/// Éú³ÉÊÓƵ²¥·ÅÆ÷µÄHTM ......
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öеķ½·¨TransmitFileÀ´½â¾öʹÓÃRespo ......