ASP.NET 檔°¸ÏÂ載
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öÐµķ½·¨TransmitFileÀ´½â¾öʹÓÃResponse.BinaryWrite
ÏÂÔØ³¬¹ý400mbµÄÎļþʱµ¼ÖÂAspnet_wp.exe½ø³Ì»ØÊÕ¶øÎÞ·¨³É¹¦ÏÂÔØµÄÎÊÌâ¡£
´úÂëÈçÏ£º
*/
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition", "attachment;filename=z.zip");
string filename = Server.MapPath("DownLoad/z.zip");
Response.TransmitFile(filename);
}
//WriteFileʵÏÖÏÂÔØ
protected void Button2_Click(object sender, EventArgs e)
{
/*
using System.IO;
*/
string fileName = "asd.txt";//¿Í»§¶Ë±£´æµÄÎļþÃû
string filePath = Server.MapPath("DownLoad/aaa.txt");//·¾¶
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
Ïà¹ØÎĵµ£º
ÔÚC#ÖУ¬static±äÁ¿±íʾ¸Ã±äÁ¿ÊôÓÚÀ࣬¶ø²»ÊÇÀàµÄʵÀý¡£¿ÉÒÔ˵ÊǸÃÀàµÄËùÓÐʵÀý¹²ÏíÒ»¸östatic±äÁ¿¡£
asp.netµÄÒ³Ãæ¾ÍÊÇÒ»¸öÀ࣬ÎÒÃÇ·ÃÎÊÒ»¸öÒ³Ãæ¡£¾Í»áÔÚ·þÎñÆ÷ÉÏʵÀý»¯Ò»¸ö¸ÃÀàµÄʵÀý£¬À´ÏìÓ¦ÎÒÃǵÄÇëÇó¡£
“ËùÓÐʵÀý¹²ÏíÒ»¸östatic±äÁ¿” Õâ¾ÍÒâζ×Å£¬ËùÓеĿͻ§¶Ë·ÃÎʵ½µÄasp.netÒ³ÃæÖÐstatic±äÁ¿¶¼ÊÇͬһ¸ ......
ASP.NET ÖеÄÉè¼ÆÄ£Ê½Ö®MVCƪ
ASP.NET
ÖеÄÉè¼ÆÄ£Ê½Ö®
MVC
ƪ
Éè¼ÆÄ£Ê½
MVC
Ò³Ãæ¿ØÖÆÆ÷
Ä£°åÓë
Page
»ùÀà
Éè¼ÆÄ£Ê½
Èí¼þ¿ª·¢ÖУ¬Èí¼þ¸´ÓúÍÍŶÓÐ×÷¶¼Ò»Ö±ÊÇ×îΪÈËÃǹØ×¢µÄÖØÒªÎÊÌâÖ®Ò»¡£ÓÐȤµÄÊÇ£¬ÕâÁ½¸öËÆºõÊôÓÚÈí¼þ¹¤³Ì·¶³ëµÄÎÊÌâ¶¼ÓÐÒ»¸ö¹²Í¬µÄ¼¼Êõ·½ÃæµÄ½â¾öÖ®µÀ£ºÉè¼ÆÄ£Ê½¡£
  ......
ÏÂÃæÊÇд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");//Ôö¼ ......
js code //Ö÷Òª¹¦ÄÜÊÇʵÏÖ¸´Ñ¡¿òµÄȫѡÔñ¸ú·Çȫѡ
<script type="text/javascript" defer="defer">
function OnTreeNodeChecked() {
var ele = event.srcElement;
&nbs ......
using System;
using System.Collections;
using System.Collections.Specialized;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Text;
namespace Maticsoft.DBUtility
{
/// <summary>
  ......