ASP.NETÖÐExcel²Ù×÷ÀàC#°æ
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Office.Interop;
using Microsoft.Office.Core;
namespace ExcelEdit
{
/// <summary >
/// ExcelEdit µÄժҪ˵Ã÷
/// </summary >
public class ExcelEdit
{
public string mFilename;
public Excel.Application app;
public Excel.Workbooks wbs;
public Excel.Workbook wb;
public Excel.Worksheets wss;
public Excel.Worksheet ws;
public ExcelEdit()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
}
public void Create()//´´½¨Ò»¸öExcel¶ÔÏó
{
app = new Excel.Application();
wbs = app.Workbooks;
wb = wbs.Add(true);
}
public void Open(string FileName)//´ò¿ªÒ»¸öExcelÎļþ
{
app = new Excel.Application();
wbs = app.Workbooks;
wb = wbs.Add(FileName);
//wb = wbs.Open(FileName, 0, true, 5, " ", " ", true, Excel.XlPlatform.xlWindows, "\t ", false, false, 0, true,Type.Missing,Type.Missing);
//wb = wbs.Open(FileName,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Excel.XlPlatform.xlWindows,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing,Type.Missing);
mFilename = FileName;
}
public Excel.Worksheet GetSheet(string SheetName)//»ñÈ¡Ò»¸ö¹¤×÷±í
{
Excel.Worksheet s = (Excel.Worksheet)wb.Worksheets[SheetName];
return s;
}
Ïà¹ØÎĵµ£º
ÈÏʶASP.NETÅäÖÃÎļþWeb.config
×÷ÕߣºSabine¡¡À´Ô´£ºÈüµÏÂÛ̳
¡¡¡¡Ò»¡¢ÈÏʶWeb.configÎļþ
Web.configÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢£¨Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½£©£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ýVB.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿ ......
Asp.net¿Ø¼þ£¨°üÀ¨Web·þÎñÆ÷¿Ø¼þºÍHtml·þÎñÆ÷¿Ø¼þ£©¶¼Ã»ÓÐË«»÷ʼþ£¬ÄÇô¸ÃÈçºÎ½«Ë«»÷ʼþ¸¶¸øAsp.Net¿Ø¼þÄØ£¿ÎÒÃÇÒÔLable¿Ø¼þΪÀý¡£
Ò»¡¢Ê×ÏȼÓÈë¿Ø¼þ£¬IDΪLable1£¬È»ºó¼ÓÈëÒ»¸öButton¿Ø¼þ£¬IDΪButton1£¬´úÂëÈçÏÂ
& ......
д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","cx ......
Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that ......