asp.net¶ÁÈ¡EXcelµÄСÌÖÂÛ
ÔÚCSÎļþÖУ¬Ê×ÏÈÔÚ¶¥²¿ÒýÈë²Ù×÷ExcelÊý¾ÝµÄÃüÃû¿Õ¼ä
using System.Data.OleDb;
Õýʽ´úÂëÈçÏ£º
private void Button_Click(object sender, System.EventArgs e)
{
string thefullname = this.uploadFile.PostedFile.FileName;//»ñÈ¡ÍêÕû·¾¶
ClientScriptManager csm = Page.ClientScript;
if (thefullname == "")
{
csm.RegisterStartupScript(GetType, "Error", "alert('ÇëÑ¡ÔñÒªÉÏ´«µÃExcelÎļþ');", true);
return;
}
int fileLength = this.uploadFile.PostedFile.ContentLength;
if (fileLength > 512000)
{
csm.RegisterStartupScript(GetType, "Error", "alert('ÎļþÒѳ¬¹ý500K£¬ÎÞ·¨ÉÏ´«£¡');", true);
return;
}
FileInfo info = new FileInfo(thefullname);
string fileExt = info.Extension;
if (fileExt.ToLower() != ".xls")
{
csm.RegisterStartupScript(GetType, "Error", "alert('²»ÊÇExcelÎļþ£¬ÇëʹÓÃÕýÈ·µÄÎļþ¸ñʽ£¡');", true);
return;
}
string uploadPath = Page.MapPath(@"uploadfile\report.xls");
 
Ïà¹ØÎĵµ£º
TreeView Web ·þÎñÆ÷¿Ø¼þ¿ÉÒÔÏÔʾ¸÷ÖÖ²»Í¬ÀàÐ͵ÄÊý¾Ý£º¿Ø¼þÖÐÒÔÉùÃ÷·½Ê½Ö¸¶¨µÄ¾²Ì¬Êý¾Ý£»°ó¶¨µ½¸Ã¿Ø¼þµÄÊý¾Ý£»»òΪÏìÓ¦Óû§²Ù×÷¶ø¶¯Ì¬Ìí¼Óµ½ TreeView ¿Ø¼þÖеÄÊý¾Ý¡£
Ò»¡¢ÏÔʾ¾²Ì¬Êý¾Ý
×î¼òµ¥µÄÊý¾Ý¼Ü¹¹ÊÇÉùÃ÷ÐÔ¾²Ì¬Êý¾Ý¡£ÈôҪʹÓÃÉùÃ÷ÐÔÓï·¨ÏÔʾ¾²Ì¬Êý¾Ý£¬Çë´´½¨Ò»¸ö TreeView ¿Ø¼þ× ......
ʹÓà ASP.NET TreeView ¿Ø¼þ¿ÉÒÔÇáËɵذ󶨵½Ö§³Ö IHierarchicalDataSource ½Ó¿ÚµÄÊý¾ÝÔ´£¬ÀýÈ磺XmlDataSource ÀàºÍ SiteMapDataSource Àà¡£´ËÍ⣬Äú»¹¿ÉÒÔÍêÈ«¿ØÖƽ«Êý¾ÝÔ´µÄÄÄЩ×Ö¶ÎÓÃÓÚ Text¡¢Value ºÍÆäËû TreeNode ÊôÐÔ¡£
Ò»¡¢°ó¶¨µ½ XML Îļþ
TreeView ¿Ø¼þÖ§³Öµ½ XML ......
//2007Äê4ÔÂ24ÈÕ
this.TextBox6.Text = System.DateTime.Now.ToString("D");
//2007-4-24
this.TextBox7.Text = System.DateTime.Now.ToString("d");
//2007Äê4ÔÂ24ÈÕ 16:30:15
this. ......
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
  ......