ASP.NET读取word到页面
JavaScript实现:
<mce:script type ="text/javascript" ><!--
function readWord()
{
var div1=document .getElementById ("div1");
var WordApp,WordDoc,Str;
WordApp =new ActiveXObject ("Word.application");
WordDoc =WordApp.Documents.Open("F:\\工作日志.doc");
Str =WordDoc .content.text;
WordDoc .close();
WordApp .quit();
div1.innerHTML =Str ;
}
// --></mce:script>
<div id="div1">
</div>
<input id="Button2" type="button" value="button" OnClick ="readWord();"/>
C#实现:(添加office引用)
<asp:Literal ID="Literal1" runat="server"></asp:Literal>
protected void Page_Load(object sender, EventArgs e)
{
this .Literal1 .Text =GetTest ("F:\\工作日志.doc");
}
public string GetTest(string FileName)
{
Microsoft.Office.Interop.Word.ApplicationClass WordApi = new Microsoft.Office.Interop.Word.ApplicationClass();
object fileObject = FileName;
object nullobj = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = WordApi.Documents.Open(ref fileObject, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
string StrText = doc.Content.Text;
doc.Close(ref nullobj, ref nullobj, ref nullobj);
WordApi.Quit(ref nullobj, ref nullobj, ref nullobj);
return StrText;
}
相关文档:
1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryS ......
招聘:“女士”网站开发的asp.net程序员。能独立工作。有购物网站经验。会CSS+DIV。
符合条件要求的。请立刻与我联系或帮助介绍一位谢谢你。
公司:河北廊坊市金冠科技有限公司
网址:www.jinguankeji.net www.shangguzhijia.com
人事部:陈立国 QQ:752492158
邮箱:clg1970@163.com手机:1378 ......
介绍
缓存是在内存存储数据的一项技术,也是ASP.NET中提供的重要特性之一。例如你可以在复杂查询的时候缓存数据,这样后来的请求就不需要从数据库中取数据,而是直接从缓存中获取。通过使用缓存可以提高应用程序的性能。
主要有两种类型的缓存:
1.输出缓存Output caching
2.数据缓存Data caching
1. 输出缓存 ......
1,新建一名为login.htm的静态网页文件,作为登录页面,如图
body标签代码
<body onkeydown ="enterLogin()"> <!--添加按下键盘事件-->
<div style="text-align: center" mce_style="text-align: center">
<table border="1" cellpadding="1">
<tr>
<td align="center" s ......
转载于:http://hi.baidu.com/juzi119/blog/item/d4bf9a4b7cea7df583025c9e.html
C 货币 2.5.ToString("C") ¥2.50
D 十进制数 25.ToString("D5") 00025
E 科学型 25000.ToString("E") 2.500000E+005
F 固定点 25.ToString("F2") 25.00
G 常规 2.5.ToString("G") 2.5
N 数字 2500000. ......