asp.net µ¼³öExcel/Word
asp.netÖе¼³öÓкܶ෽·¨¡£ÆäÖбȽÏÍƼöµÄ¼æÈݵ¼³öÊǵ¼³öΪword/excel¼æÈݵÄmhtml¸ñʽ²¢ÉèÖÃÁ÷¸ñʽΪword»òexcel¡£
ÕâÖз½·¨µÄºÃ´¦ÊÇ¿ÉÒÔ½¨Á¢Ò»¸öͨÓõĿ⡣±¾ÎÄÖÐÌá³öÁËÒ»¸öͨÓõĵ¼³öÀ࣬ʵ¼ùÖÐʹÓÃЧ¹û½ÏºÃ¡££¨ps£¬html½âÎöÀàдµÄ±È½Ï²Ö´Ù£¬¸÷λÈçÓÐÐËȤ¿ÉÖØдһÏÂ~£©
///
///@Author Simsure
///@Version 1.0
///
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
using System.Net;
using System.IO;
/// <summary>
///MHtmlDocument µÄժҪ˵Ã÷
/// </summary>
public class MHtmlDocument
{
protected const string _NEXT_PART = "------=_NextPart_WIND";
protected const string _4NEXT_PART = "----=_NextPart_WIND";
private const string WIND_SESSION_ID = "wind.sessionid";
protected string _encoding = "utf-8";
protected string _pageVirutalPath;
protected string _rootHttpVirtualPath;
protected bool _enableBase64 = false;
protected HtmlDocument _baseDocument;
protected HttpRequest _request;
protected HttpResponse _response;
protected static readonly log4net.ILog _log = log4net.LogManager.GetLogger("MHtmlDocument");
public string Encoding
{
get { return _encoding; }
}
public string RootHttpVirtualPath
{
get { return _rootHttpVirtualPath; }
}
public string PageVirtualPath
{
get { return _pageVirutalPath; }
}
public bool EnableBase64
{
get { return _enableBase64; }
set { _enableBase6
Ïà¹ØÎĵµ£º
//ƽ³£µ÷ÓÃjavascript·½·¨
ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert'Weclome!!!');</script>");
±³¾°²»Îª°×É«µÄ·½·¨£º
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('Ìí¼Óʧ°Ü£¬ÇëÁªÏµ¼¼ÊõÔ±£¡') ......
ASP.NET²Ù×÷Êý¾Ý¿â
ͨ¹ý¶ÔADO.NETµÄ»ù±¾½²½â£¬ÒÔ¼°½²½âÁËһЩÊý¾ÝÔ´¿Ø¼þµÄ»ù±¾Ó÷¨ºó£¬±¾Õ½«½éÉÜһЩASP.NET²Ù×÷Êý¾Ý¿âµÄ¸ß¼¶Ó÷¨£¬°üÀ¨Ê¹ÓÃSQLHelper£¬ÒÔ¼°Êý¾ÝÔ´¿Ø¼þ¶ÔÊý¾ÝµÄ²Ù×÷¡£±¾ÕÂÊǶÔÇ°ÃæµÄÊý¾Ý¿â֪ʶµÄÒ»ÖÖ²¹³äºÍÌáÉý¡£
9.1 ʹÓÃADO.NET²Ù×÷Êý¾Ý¿â
ÉÏÒ»ÕÂÖнéÉÜÁËADO.NETµÄ»ù±¾¸ÅÄî¡¢ADO.NETµÄ¶ÔÏó£¬ÒÔ¼ ......
URL ÖØдÊǽØÈ¡´«Èë Web ÇëÇó²¢×Ô¶¯½«ÇëÇóÖض¨Ïòµ½ÆäËû URL µÄ¹ý³Ì¡£
±ÈÈçä¯ÀÀÆ÷·¢À´ÇëÇóhostname/101.aspx £¬·þÎñÆ÷×Ô¶¯½«Õâ¸öÇëÇóÖж¨ÏòΪhttp://hostname/list.aspx?id=101¡£
urlÖØдµÄÓŵãÔÚÓÚ£º
Ëõ¶Ìurl£¬Òþ²Øʵ¼Ê·¾¶Ìá¸ß°²È«ÐÔ
Ò×ÓÚÓû§¼ÇÒäºÍ¼üÈë¡£
&nbs ......
ÔÚASP.NET2.0ÖУ¬ÎªÎÒÃÇÌṩÁËÁ½ÖÖй¦ÄÜ£¬·½±ãÎÒÃÇÖÆ×÷¹²Í¬ÌØÕ÷Ò»ÖµÄÒ³ÃæºÍµ¼º½¡£ÕâÁ½ÖÖ¹¦ÄÜÊÇĸ°åÒ³ºÍÍøÕ¾µ¼º½¡£¶ÔÓÚĸ°åÒ³´ó¼ÒºÜÇå³þÁË£¬²»¹ýÔÚ×öĸ°åҳʱ£¬¾³£ÐèÒªÌí¼Óµ¼º½À¸£¬¶ÔÓÚ´Ëasp.net 2.0 ʹÎÒÃǵŤ×÷´óΪ¼ò»¯¡£Õâ±ãÊÇÕ¾µãµØͼµÄʹÓá£
¹ËÃû˼Ò壬վµãµØͼ¾ÍÊÇÔÚÕ¾µã ......
#region 1
private void CreateCheckCodeImage()
{
//»ñÈ¡Ëæ¼´×Ö·û´®
int number;
char code;
string checkCode = String.Empty;
System.Random random1 = new Random();
for (int i = 0; i < 5; i++)
{
number = random1.Next( ......