´ÓÊý¾Ý¿âµ¼³öÊý¾Ýµ½word¡¢excel¡¢.txt _asp.net¼¼ÇÉ
ת×Ôhttp://martinyang2010.bokee.com/2598999.html
using System;
using System.Data;
using System.Drawing;
using System.Data.SqlClient;
using Excel;
using Word;
using System.IO;
namespace Common
{
/// <summary>
/// °ÑÊý¾Ýµ¼Èëµ½.doc¡¢.txt¡¢.xlsÎļþÖÐ
/// </summary>
public class Export
{
private const string DATAWORDPATH = @"C:\folder\doc\datadoc\";
private const string IMAGEWORDPATH = @"C:\folder\doc\imagedoc\";
private const string IMAGEPATH = @"C:\folder\image\";
private const string EXCELPATH = @"C:\folder\excel\";
private const string TXTPATH = @"C:\folder\txt\";
private const string IMAGEPOSTFIX = ".bmp";
private const string WORDPOSTFIX = ".doc";
private const string EXCELPOSTFIX = ".xls";
private const string TXTPOSTFIX = ".txt";
private const int DATADISTANCE = 5;
private const int TABDISTANCE = 8;
public Export()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
}
/// <summary>
/// »ñµÃÊý¾Ý¼¯Dataset--------------------------------ÓÃÓÚµ÷ÊÔ
/// </summary>
/// <returns>Dataset</returns>
public DataSet GetData()
{
try
{
string sConnectionString;
sConnectionString = "workstation id=GUOFU;packet size=4096;user id=sa;data source=GUOFU;persist security info=True;initial catalog=YC;password=sc";
SqlConnection objConn = new SqlConnection(sConnectionString);
objConn.Open();
SqlDataAdapter daPoint = new SqlDataAdapter("Select * from Point", objConn);
DataSet dsYC = new DataSet("YC");
daPoint.FillSchema(dsYC,SchemaType.Mapped, "Point");
&nb
Ïà¹ØÎĵµ£º
[ת]asp.netµ¼³öExcel/Csv¸ñʽÊý¾Ý×îÓÅ·½°¸£¨C#£©
±¾ÎÄת×Ô£ºhttp://www.cnblogs.com/lovenets2008/archive/2008/05/06/1184234.html
ÔÎÄÈçÏ£º
ºÃ¾ÃûÓÐдµãʲôÁË£¬Ò²ÐíÊÇ̫æ¡£Ò»ÄêÁË£¬»ýÀÛÁ˲»ÉٺõĶ«¶«£¬Óлú»áʱ¾Íд³öÀ´Óë´ó¼Ò·ÖÏí¡£
ºÃ£¬ÑÔ¹éÕý´«¡£
µ¼³öµ½Excel/CscÎļþ²¢²»ÄÑ£¬ËùÒÔ¾ÍÓкö෽·¨£ ......
ASP.NET IIS ×¢²á¹¤¾ß (Aspnet_regiis.exe)
ÔÚһ̨¼ÆËã»úÉϲ¢ÐÐÖ´Ðжà¸ö .NET Framework °æ±¾Ê±£¬Ó³Éäµ½ ASP.NET Ó¦ÓóÌÐòµÄ ASP.NET ISAPI °æ±¾¾ö¶¨Á˸ÃÓ¦ÓóÌÐòËùʹÓõĹ«¹²ÓïÑÔÔËÐпâ (CLR) °æ±¾¡£Ê¹Óà ASP.NET IIS ×¢²á¹¤¾ß (Aspnet_regiis.exe)£¬¹ÜÀíÔ±»ò°²×°³ÌÐò¿ÉÒÔ·½±ãµØ¸üРASP.NET Ó¦ÓóÌÐòµÄ½Å±¾Ó³É䣬ʹÆäÖ¸Ï ......
Ö÷Ìå¼Ü¹¹
¡¡¡¡¸÷ƵµÀ·Ö±ðλÓÚ²»Í¬µÄWeb Project(¾ßÓжÀÁ¢µÄ¶þ¼¶ÓòÃû)£¬²¢½«ËùÓеÄÒµÎñÂß¼ÒÔ¼°Êý¾Ý·ÃÎʹ¦ÄÜ·â×°³ÉClass Library£¬ËùÓÐƵµÀ¹²ÓÃÕâ¸öClass Library¡£
¡¡¡¡ÏÂÃæÏêϸ½éÉÜʵÏÖ·½·¨¡£
¡¡¡¡¼ÙÉèÍøÕ¾ÓÐÈý¸öƵµÀ£¬ÐÂÎÅ¡¢ÂÛ̳ÒÔ¼°²©¿Í£¬¶ÔÓ¦µÄ¶þ¼¶ÓòÃûΪ"news"¡¢"forum"¡¢"blog"¡£³ ......
Ò»£®Code Behind¼ò½é
¡¡¡¡Code Behind¾ÍÊÇËùνµÄ´úÂë·ÖÀ룬×Ô´ÓMicrosoft¹«Ë¾ÍƳöÁËASP.NETÒÔºó£¬Code
Behind¾ÍÊÇÒ»¸öÈÈÃŵĻ°Ìâ¡£ÔÚÒ»°ãµÄASP.NETÎļþÖУ¬Code
BehindÖ÷ÒªÊÇÓöþ¸öÎļþÀ´´´½¨Ò»¸öASP.NETµÄÒ³Ã棬ÆäÖÐÒ»¸öÊÇÉè¼ÆÎļþ£¬Ò»°ãÒÔ.aspx»òÕß.ascx×öΪÀ©Õ¹Ãû£¬¶øÁíÍâÒ»¸öÊdzÌÐò´úÂëÎÄ
¼þ£¬Ò»°ãÒÔ.vb»òÕß.cs×öΪ ......