Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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);
     


Ïà¹ØÎĵµ£º

c# Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary

/// <summary>
/// Ö§³ÖXMLÐòÁл¯µÄ·ºÐÍ Dictionary
/// </summary>
/// <typeparam name="TKey"></typeparam>
/// <typeparam name="TValue"></typeparam>
[XmlRoot("SerializableDictionary")]
public class SerializableDictionary<TKey, TValue& ......

¹é½áÒ»ÏÂ×Ó:C#Ïß³Ìͬ²½µÄ¼¸ÖÖ²½Öè

ÎÒÃÇÔÚ±à³ÌµÄʱ·Ö£¬ÓÐʱ»áÔËÓöàÏß³ÌÀ´½â¾öÎÊÌ⣬ÀýÈçÄãµÄ³ÌÐò¼±ÐèÔÚºǫ́ÀÏ°å´¦ÖÃÒ»´ó¶ÑÊý¾Ý£¬µ«»¹ÒªÊ©Óû§½çÃæ¾ÓÓڿɲÙ×÷״̬£»»òÐíÄãµÄ³ÌÐòؽÐè·ÃÎÊһЩÍⲿ×ÊԴϤÊý¾Ý¿â»òÍøÂç×ÊÁϵȡ£ÕâЩ¾°¿öÄ㶼¿ÉÒÔ´´ÉèÒ»¸öÍ·Ïß³ÌÈ¥´¦Öã¬È»Ôò£¬¶àÏ̲߳»¿ÉÄæתµØ»á´ø»ØÒ»¸öÎÊÌ⣬ÄËÊÇÏß³Ìͬ²½µÄÎÊÌâ¡£ÈçÆäÕâ¸öÎÊÌâ´¦ÖÃÔã¸â£¬ÎÒÃǾͻá ......

C#ÓïÑԹ淶

1. ÃüÃû¹æ·¶
a)    Àà
¡¾¹æÔò1-1¡¿Ê¹ÓÃPascal¹æÔòÃüÃûÀàÃû£¬¼´Ê××ÖĸҪ´óд¡£
¡¾¹æÔò1-2¡¿Ê¹ÓÃÄܹ»·´Ó³À๦ÄܵÄÃû´Ê»òÃû´Ê¶ÌÓïÃüÃûÀà¡£
¡¾¹æÔò1-3¡¿²»ÒªÊ¹ÓÓI”¡¢“C”¡¢“_”µÈÌض¨º¬Òåǰ׺¡£
¡¾¹æÔò1-4¡¿×Ô¶¨ÒåÒì³£ÀàÓ¦ÒÔException½áβ¡£
¡¾¹æÔò1-5¡¿ÎļþÃûÒªÄÜ·´Ó ......

dz̸C#·ºÐ͵ÄÓô¦

ΪʲôҪʹÓÃC#·ºÐÍ?
ΪÁËÁ˽âÕâ¸öÎÊÌ⣬ÎÒÃÇÏÈ¿´ÏÂÃæµÄ´úÂ룬´úÂëÊ¡ÂÔÁËһЩÄÚÈÝ£¬µ«¹¦ÄÜÊÇʵÏÖÒ»¸öÕ»£¬Õâ¸öÕ»Ö»ÄÜ´¦ÀíintÊý¾ÝÀàÐÍ£º
public class Stack
    {
        private int[] m_item;
        public ......

dzÎö¹¤³§Ä£Ê½(C#)

ÎÒÒÔΪ£¬ÔÚËùÓÐģʽÖУ¬×î¼òµ¥¡¢×î³£ÓõľÍÊǹ¤³§Ä£Ê½ÁË£¨°üÀ¨³éÏ󹤳§£©¡£
¹¤³§Ä£Ê½ºÍ³éÏóģʽµÄÇø±ðÔÚÓÚ£¬¹¤³§Ä£Ê½ÊÇͨ¹ý²ÎÊý£¨Ò»°ã½ÐÐͱðÂ룩À´¶¯Ì¬Éú³É¶ÔÏ󣬶ø³éÏ󹤳§±ØÐëÁ˽âÉÏÏÂÎIJÅÄܵ÷ÓÃÏàÓ¦µÄ¶ÔÏó¡£ÊµÀý´úÂëÈçÏ£º
Ò»¡¢¹¤³§Ä£Ê½
public class Factory
{
public static object Create(int type)
{ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ