c#ʵÏÖÏÂÔØ´úÂëÊÕ¼¯
//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);
Ïà¹ØÎĵµ£º
/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......
ÎÒÃÇÔÚ±à³ÌµÄʱ·Ö£¬ÓÐʱ»áÔËÓöàÏß³ÌÀ´½â¾öÎÊÌ⣬ÀýÈçÄãµÄ³ÌÐò¼±ÐèÔÚºǫ́ÀÏ°å´¦ÖÃÒ»´ó¶ÑÊý¾Ý£¬µ«»¹ÒªÊ©Óû§½çÃæ¾ÓÓڿɲÙ×÷״̬£»»òÐíÄãµÄ³ÌÐòؽÐè·ÃÎÊһЩÍⲿ×ÊԴϤÊý¾Ý¿â»òÍøÂç×ÊÁϵȡ£ÕâЩ¾°¿öÄ㶼¿ÉÒÔ´´ÉèÒ»¸öÍ·Ïß³ÌÈ¥´¦Öã¬È»Ôò£¬¶àÏ̲߳»¿ÉÄæתµØ»á´ø»ØÒ»¸öÎÊÌ⣬ÄËÊÇÏß³Ìͬ²½µÄÎÊÌâ¡£ÈçÆäÕâ¸öÎÊÌâ´¦ÖÃÔã¸â£¬ÎÒÃǾͻá ......
1. ÃüÃû¹æ·¶
a) Àà
¡¾¹æÔò1-1¡¿Ê¹ÓÃPascal¹æÔòÃüÃûÀàÃû£¬¼´Ê××ÖĸҪ´óд¡£
¡¾¹æÔò1-2¡¿Ê¹ÓÃÄܹ»·´Ó³À๦ÄܵÄÃû´Ê»òÃû´Ê¶ÌÓïÃüÃûÀà¡£
¡¾¹æÔò1-3¡¿²»ÒªÊ¹ÓÓI”¡¢“C”¡¢“_”µÈÌض¨º¬Òåǰ׺¡£
¡¾¹æÔò1-4¡¿×Ô¶¨ÒåÒì³£ÀàÓ¦ÒÔException½áβ¡£
¡¾¹æÔò1-5¡¿ÎļþÃûÒªÄÜ·´Ó ......
ΪʲôҪʹÓÃC#·ºÐÍ?
ΪÁËÁ˽âÕâ¸öÎÊÌ⣬ÎÒÃÇÏÈ¿´ÏÂÃæµÄ´úÂ룬´úÂëÊ¡ÂÔÁËһЩÄÚÈÝ£¬µ«¹¦ÄÜÊÇʵÏÖÒ»¸öÕ»£¬Õâ¸öÕ»Ö»ÄÜ´¦ÀíintÊý¾ÝÀàÐÍ£º
public class Stack
{
private int[] m_item;
public ......
ÎÒÒÔΪ£¬ÔÚËùÓÐģʽÖУ¬×î¼òµ¥¡¢×î³£ÓõľÍÊǹ¤³§Ä£Ê½ÁË£¨°üÀ¨³éÏ󹤳§£©¡£
¹¤³§Ä£Ê½ºÍ³éÏóģʽµÄÇø±ðÔÚÓÚ£¬¹¤³§Ä£Ê½ÊÇͨ¹ý²ÎÊý£¨Ò»°ã½ÐÐͱðÂ룩À´¶¯Ì¬Éú³É¶ÔÏ󣬶ø³éÏ󹤳§±ØÐëÁ˽âÉÏÏÂÎIJÅÄܵ÷ÓÃÏàÓ¦µÄ¶ÔÏó¡£ÊµÀý´úÂëÈçÏ£º
Ò»¡¢¹¤³§Ä£Ê½
public class Factory
{
public static object Create(int type)
{
......