C# wordת»»³ÉHTML
C# wordת»»³ÉHTML
Ìí¼ÓcomÒýÓÃMicrosoft word 11.0 Object Library
Ìí¼Óusing System.Threading;using System.IO;
//ʵÀý»¯Ò»¸öWord
Microsoft.Office.Interop.Word.ApplicationClass appclass = new Microsoft.Office.Interop.Word.ApplicationClass();
Type wordtype = appclass.GetType();
Microsoft.Office.Interop.Word.Documents docs = appclass.Documents;//»ñÈ¡Document
Type docstype = docs.GetType();
object filename = @"E:\AA.doc";//WordÎļþµÄ·¾¶
Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)docstype.InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, docs, new object[] { filename, true, true });//´ò¿ªÎļþ
Type doctype = doc.GetType();
object savefilename = @"E:\bb.html";//Éú³ÉHTMLµÄ·¾¶ºÍÃû×Ó
doctype.InvokeMember("SaveAs", System.Reflection.BindingFlags.InvokeMethod, null, doc, new object[] { savefilename, Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatHTML });//Áí´æÎªHtml¸ñʽ
wordtype.InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod, null, appclass, null);//Í˳ö
Thread.Sleep(3000);//ΪÁËʹÍ˳öÍêÈ«£¬ÕâÀï×èÈû3Ãë
StreamReader objreader = new StreamReader(savefilename.ToString(), System.Text.Encoding.GetEncoding("GB2312"));
//ÒÔÏÂÄÚÈÝÊÇΪÁËÔÚHtmlÖмÓÈë¶Ô±¾ÉíWordÎļþµÄÏÂÔØ
 
Ïà¹ØÎĵµ£º
ÒÑÖªÓÐÒ»¸öXMLÎļþ£¨bookstore.xml£©ÈçÏ£º
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
<title>Oberon's Legacy</title>
<author>Corets, Eva</author>
&nb ......
Ò»¸öC# xml ÐòÁл¯´íÎó
Ê·¢ÏÖ³¡£º
xmlÐòÁл¯µÄÊý¾ÝÖд洢µÄ½ÚµãÊý¾ÝÊÇ
<Module>536870912</Module> £¨xmlÎļþÖУ©
¶ÔÓ¦µÄÀàÊôÐÔÊÇ
public short Module { get; set; } £¨C#ÀàÖУ©
ÐòÁл¯µÄ´úÂ룺
public static FMDSTimeSeriesDefinitio ......
´Ë½Ì³ÌÏòÄãÌṩ ASP.NET MVC ÊÓͼ¼ò½é, ÊÓͼÊý¾Ý, ºÍ HTML Helpers¡£½Ì³Ì×îºó£¬ÄãÓ¦¸Ã»áÀí½âÈçºÎ´´½¨ÐÂÊÓͼ£¬´Ó¿ØÖÆÆ÷´«µÝÊý¾Ýµ½ÊÓͼ£¬ºÍʹÓà use HTML Helpers ÔÚÊÓͼÖÐÉú³ÉÄÚÈÝ¡£
Àí½âÊÓͼ
²»Ïñ ASP.NET »òÕßASP, ASP.NET MVC ²¢²»°üÀ¨ÈκÎÖ±½Ó¶ÔÓ¦Ò³ÃæµÄ¶«Î÷¡£ ÔÚ ASP.NET MVC Ó¦ÓóÌÐòÖУ¬Ó²ÅÌÉϲ¢²»´ ......
ASP.NET³ÌÐòÖг£ÓõÄÈýÊ®ÈýÖÖ´úÂë
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
¡¡¡¡´«ËͲÎÊý£º
response.write("£¼script£¾window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)£¼/script£¾")
¡¡¡¡½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string& ......
sd.xmlÎļþ:
<?xml version="1.0" encoding="gb2312"?>
<!--ÕâÊÇÒ»¸öxmlÎļþ-->
<xml1>
<item name="1">µÚÒ»¸öitem</item>
<item name="2">
<item name="1">Õâ¸ö½áµã(1) ......