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

C#µ¼³öxls,word,ͼƬ¼°ÑùʽÎÊÌâ

public void ExportControl(System.Web.UI.Control source, string DocumentType, string filename)
{
//ÉèÖÃHttpµÄÍ·ÐÅÏ¢,±àÂë¸ñʽ
HttpContext.Current.Response.Buffer = true;
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ClearContent();
HttpContext.Current.Response.ClearHeaders();
if (DocumentType.ToLower() == "excel")
{
//Excel
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename + ".xls", System.Text.Encoding.UTF8));
HttpContext.Current.Response.ContentType = "application/ms-excel";
}
else if (DocumentType.ToLower() == "word")
{
//Word
HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename + ".doc", System.Text.Encoding.UTF8));
HttpContext.Current.Response.ContentType = "application/ms-word";
}
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.HeaderEncoding=System.Text.Encoding.UTF8;
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;
//¹Ø±Õ¿Ø¼þµÄÊÓͼ״̬
source.Page.EnableViewState = false;
//³õʼ»¯HtmlWriter
System.IO.StringWriter writer = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(writer);
source.RenderControl(htmlWriter);
//Êä³ö
HttpContext.Current.Response.Write(writer.ToString());
HttpContext.Current.Response.End();
}
    //·½·¨ExportControl(System.Web.UI.Control source, string DocumentType,string filename)ÖÐ
    //µÚÒ»¸ö²ÎÊýsource±íʾµ¼³öµÄÒ³Ãæ»ò¿Ø¼þÃû,µ±Îªdata


Ïà¹ØÎĵµ£º

C#дXMLµÄ¼òµ¥Àý×Ó

Õâ¸öÀý×ÓÒª°Ñbookstore.xmlÎļþÔö¼ÓÒ»Ìõbook¼Ç¼
1 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="love" ISBN="1234123">
    <title>who am i </title>
    <author>who</author>
   ......

C#ÐÞ¸ÄXMLµÄ¼òµ¥Àý×Ó

½ÓÉÏһƪ¡¶C#дXMLµÄ¼òµ¥Àý×Ó¡·
Õâ¸öÀý×ÓÒªÐÞ¸ÄXMLÎļþÖнáµãµÄÊôÐԺͺÍÔªËØµÄÎı¾
1 Ô­xmlÎļþ bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="love" ISBN="1234123">
    <title>who am i </title>
    &l ......

»ùÓÚC#µÄMapInfo¿ª·¢Ê±³£ÓõÄÃüÃû¿Õ¼ä×ܽá


ÃüÃû¿Õ¼ä£º  MapInfo.Data
MapInfo.Data ÃüÃû¿Õ¼ä°üº¬ÁËʵÏÖ MapInfo .NET Êý¾ÝÌṩ·½µÄÀàºÍ½Ó¿Ú¡£ ¶Ô MapInfo Êý¾ÝµÄ·ÃÎÊÓÐÁ½ÖÖÐÎʽ£º×÷ΪʹÓàSQL ÓëÊý¾Ý½»»¥µÄ ADO.NET Êý¾ÝÌṩ³ÌÐòºÍ×÷ΪʹÓÃÀàÓëÊý¾Ý½»»¥µÄ Feature ¶ÔÏó¡£ MapIn ......

c#¼Ì³Ð¸¸À༼ÇÉ,²¢Ôö¼ÓеÄʵÏÖ

1 ¸¸Àà  partial class FormBillTemplet:Form
        /// <summary>
        /// Ðµ¥
        /// </summary>
        /// <param name="s ......

C# Éè¼ÆÄ£Ê½Ñ§Ï°ËÄ BuilderÉú³ÉÆ÷ģʽ


1£¬Builderģʽ
¢Ù ¼ÙÉè¹¹½¨Ò»¸ö·¿ÎÝHouseÀ࣬¸Ã·¿ÎÝÓм¸¸ö²¿·Ö×é³É£¬±ÈÈçÃÅ£¬´°£¬Ç½£¬¶øÆäÿ¸ö²¿·Ö¶¼¸»Óڱ仯£¬Èç¸öÑùʽµÄÃÅ£¬Ã¿¸öÑùʽ¶¼ÓÐÒ»¸ö»òÕß¼¸¸ö
¢Ú Èç¹ûʹÓÃÖ±¹ÛµÄÉè¼Æ·½·¨£¬Ã¿Ò»¸ö·¿Îݲ¿·ÖµÄ±ä»¯£¬¶¼½«µ¼Ö·¿ÎÝÒªÖØÐÂÐÞÕý£¨µ«ÊÇ·¿ÎÝ£¬ÃÅ£¬´°£¬Ç½¶¼Ã»Óб仯£©
 
ʵ¼ÊÉÏÊÇÓÃÀ´Ó¦¶Ô£¬ÏµÍ³µÄÖ÷ÏßÏà¶ÔÎȶ¨£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ