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

ASP.NET WordתΪPDF

1¡¢Ê×ÏÈ°²×° Microsoft Office 2007¼ÓÔØÏMicrosoft Save as PDF-¼òÌåÖÐÎİ棺ÏÂÔصØÖ·£º
http://download.microsoft.com/download/3/8/8/388812b2-0d3f-474e-a7ef-b095d3d0d3cd/SaveAsPDF.exe
2¡¢Ð½¨ÍøÕ¾ÏîÄ¿£¬Ìí¼ÓMicrosoft.Office.Interop.WordµÄÒýÓÃ
3¡¢´úÂ룺
/// <summary>
/// ת»»wordΪpdf
/// </summary>
/// <param name="filename">docÎļþ·¾¶</param>
/// <param name="savefilename">pdf±£´æ·¾¶</param>
private void ConvertWordPDF1(object filename, object savefilename)
{
Object Nothing = System.Reflection.Missing.Value;
//´´½¨Ò»¸öÃûΪWordAppµÄ×é¼þ¶ÔÏó
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.ApplicationClass();
//´´½¨Ò»¸öÃûΪWordDocµÄÎĵµ¶ÔÏó²¢´ò¿ª
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref filename, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
//ÉèÖñ£´æµÄ¸ñʽ
object filefarmat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF;
//±£´æΪPDF
doc.SaveAs(ref savefilename, ref filefarmat, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
//¹Ø±ÕÎĵµ¶ÔÏó
doc.Close(ref Nothing, ref Nothing, ref Nothing);
//ÍƳö×齨
wordApp.Quit(ref Nothing, ref Nothing, ref Nothing);
}
object filefarmat = Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatPDF;//ÉèÖñ£´æµÄ¸ñʽ£¬»¹¿ÉÒÔΪÒÔϸñʽ£º
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatHTML  //±£´æΪHTML
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF     //±£´æΪRTF
Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatText    //±£´æΪÎı¾
Micros


Ïà¹ØÎĵµ£º

40ÌõASP.NET¿ª·¢Tip

1¡¢ÔÚcompilation Ï£¬ÇëÉèÖÃdebug=false £¬ÈçÏ£º
default Language="c#" debug="false">
2¡¢ÇëʹÓÃServer.Transfer´úÌæResponse.Redirect¡£
3¡¢Ê¹ÓÃValidator¿Ø¼þ£¬ÇëÒª¾­³£¼ì²éPage.IsValid¡£
4¡¢ÇëʹÓÃforeachÑ­»·£¬¶ø²»ÊÇΪ×Ö·û´®µü´úÑ­»·¡£
5¡¢ÇëʹÓÿͻ§¶ËÑéÖ¤·½Ê½(²»ÒªÃ¿´Î¶¼ÔÚ·þÎñ¶ËÑéÖ¤)¡£
6¡ ......

asp.net ½«HTMLÎļþµ±ASPXÎļþ½âÎö

Ê×ÏÈÔÚÓ¦ÓóÌÐòµÄWEB.CONFIGÐÞ¸ÄÈçϽڵ㡣
<httpHandlers>
    <add verb="*" path="*.html" type="System.Web.UI.PageHandlerFactory"/>
</httpHandlers>
<assemblies>
    <buildProviders>
        <add ext ......

¹ØÓÚasp.netÒ³Ãæ±³¾°ÑùʽµÄÎÊÌâ

½ñÌìÓöµ½Ò»¸öÍ·ÌÛµÄÎÊÌ⣬Ð޸ıðÈËдµÄasp.netÒ³ÃæµÄÑùʽ£¬ÎÒ°ÑÔÚÒ³ÃæµÄÑùʽ´úÂë¼ôÇе½cssÎļþÖУ¬°¦£¬³ö´íÁË¡£Ñùʽ³ö²»À´¡£ÕÒÁË°ëÌì´í£¬Â·¾¶Ò²¶Ô°¡£¬¾ÍÊǵÚÒ»´Î¼ÓÔØÒ³ÃæʱÎÒÉèÖõı³¾°Í¼Æ¬³ö²»À´£¬ÔÙË¢Ò»´ÎÒ³Ãæ¾Í³öÀ´ÁË£¬²»ÖªµÀΪʲô£¬°ÑËû¿¼µ½Ò³ÃæÉϾÍOK¡£×îÖÕ»¹ÊÇÕÒ³ö´íÁË¡£×Ô¼ºÌ«Âí»¢ÁË£¬´úÂëÔõôÄÜËæ±ãcopyµÄ£¬backgr ......

ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü

 1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º //´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="++"’)£¼/script£¾")
¡¡¡¡//½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");

2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1 ......

ASP.NETÖеÄFormsºÍWindows»ìºÏÑéÖ¤

±¾ÎÄ·­Òë×Ô£ºMixing Forms and Windows Security in ASP.NET
ÕªÒª£ºASP.NET¿ª·¢ÈËÔ±Ôø¾­Îʵ½¹ýÈçºÎʹÓÃFormsºÍWindows»ìºÏÑéÖ¤¡£Paul WilsonÌṩÁËÒ»¸ö½â¾ö·½°¸À´»ñµÃWindowsÓû§Ãû£¬»òÕߣ¬½«Óû§×ªÏòµÇ¼ҳÃæ¡£
¼ò½é
ÎÒÔø¾­Óöµ½ºÜ¶àASP.NET¿ª·¢ÈËÔ±Îʵ½ÈçºÎʹÓÃFormsºÍWindows»ìºÏÑéÖ¤¡£Í¨³£µÄ»Ø´ðÊÇ£º“ASP.NET²» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ