网页里怎样显示.doc文件的内容???来者有分!!!

chenshuliang 2007-06-12 10:33:49
大家都知道网页里可以显示.txt的文件可是怎样让它显示.doc的文件呢?如果能显示,那在网页中能否编辑.doc的文件呢?
...全文
787 28 打赏 收藏 转发到动态 举报
写回复
用AI写文章
28 条回复
切换为时间正序
请发表友善的回复…
发表回复
zi12zi 2007-06-14
  • 打赏
  • 举报
回复
直接做个连接就可以用网页打开了
MicrosoftCsharp 2007-06-14
  • 打赏
  • 举报
回复
private void Page_Load(object sender, System.EventArgs e)
{
//Set the appropriate ContentType.
Response.ContentType = "application/msword";
//Get the physical path to the file.
string FilePath = MapPath("acrobat.pdf");
//Write the file directly to the HTTP content output stream.
Response.WriteFile(FilePath);
Response.End();
}
gxh0009 2007-06-14
  • 打赏
  • 举报
回复
千航控件,我整合过,但有脚本错误,不过基本功能还可以用!
chenshuliang 2007-06-14
  • 打赏
  • 举报
回复
to MicrosoftCsharp(虚心学习的人)
你知道怎么用静态页 显示.doc的内容吗?
chenshuliang 2007-06-13
  • 打赏
  • 举报
回复
to MicrosoftCsharp(虚心学习的人)
能贴个完整的代码吗?
zmacro 2007-06-13
  • 打赏
  • 举报
回复
jf
MicrosoftCsharp 2007-06-13
  • 打赏
  • 举报
回复
只要输出binary的时候把response 的header加上这句话ContentType="application/msword",就可以显示在ie上了
leo_boy 2007-06-12
  • 打赏
  • 举报
回复
http://blog.joycode.com/kaneboy/archive/2004/11/03/37889.aspx

不知道有没有对应操作excel的?
leo_boy 2007-06-12
  • 打赏
  • 举报
回复
gz
chenshuliang 2007-06-12
  • 打赏
  • 举报
回复
看不太明白 能讲解一下吗?
sm9999999 2007-06-12
  • 打赏
  • 举报
回复
ArrayList list = new ArrayList();
//按合同号查询合同详细内容
strSql="select b_content from b_contract_content where pc_contract='"+ Session["LandContract_Code"].ToString() +"' and pc_code='"+ this.txtPc_Code.Text +"'";

list=GetBinaryData(strSql,Session["LandContract_DbName"].ToString());
if(list.Count != 0)
{
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType="application/msword";
System.Web.HttpContext.Current.Response.BinaryWrite((byte[])list[0]);
System.Web.HttpContext.Current.Response.Flush();
}



public ArrayList GetBinaryData(string strSql,string strDbName)
{
try
{
string strConnection = "Provider=ASAProv;Data source="+ strDbName +";Uid=admin;Pwd=fuq82896295_16;";
OleDb_conn = new OleDbConnection(strConnection);
OleDb_conn.Open();
OleDbCommand OleDb_comm=new OleDbCommand(strSql,OleDb_conn);
OleDbDataReader dr=OleDb_comm.ExecuteReader(System.Data.CommandBehavior.SequentialAccess);
ArrayList list=new ArrayList();
while(dr.Read())
{
list.Add(dr[0]);
}

return list;
}
finally
{

OleDb_conn.Close();
}
}
}
amandag 2007-06-12
  • 打赏
  • 举报
回复
如何在Web页面上直接打开、编辑、创建Office文档

http://blog.joycode.com/kaneboy/archive/2004/11/03/37889.aspx
chenshuliang 2007-06-12
  • 打赏
  • 举报
回复
分不多可以加啊
zhuawang 2007-06-12
  • 打赏
  • 举报
回复
分不多呀
pipibegin 2007-06-12
  • 打赏
  • 举报
回复
关注
chenshuliang 2007-06-12
  • 打赏
  • 举报
回复
怎么搞插件?
dcan 2007-06-12
  • 打赏
  • 举报
回复
lz搞个插件估计能实现~呵呵jf
chenshuliang 2007-06-12
  • 打赏
  • 举报
回复
自己顶
消火栓2019 2007-06-12
  • 打赏
  • 举报
回复
ArrayList list = new ArrayList();
//按合同号查询合同详细内容
strSql="select b_content from b_contract_content where pc_contract='"+ Session["LandContract_Code"].ToString() +"' and pc_code='"+ this.txtPc_Code.Text +"'";

list=GetBinaryData(strSql,Session["LandContract_DbName"].ToString());
if(list.Count != 0)
{
System.Web.HttpContext.Current.Response.Clear();
System.Web.HttpContext.Current.Response.ContentType="application/msword";
System.Web.HttpContext.Current.Response.BinaryWrite((byte[])list[0]);
System.Web.HttpContext.Current.Response.Flush();
}



public ArrayList GetBinaryData(string strSql,string strDbName)
{
try
{
string strConnection = "Provider=ASAProv;Data source="+ strDbName +";Uid=admin;Pwd=fuq82896295_16;";
OleDb_conn = new OleDbConnection(strConnection);
OleDb_conn.Open();
OleDbCommand OleDb_comm=new OleDbCommand(strSql,OleDb_conn);
OleDbDataReader dr=OleDb_comm.ExecuteReader(System.Data.CommandBehavior.SequentialAccess);
ArrayList list=new ArrayList();
while(dr.Read())
{
list.Add(dr[0]);
}

return list;
}
finally
{

OleDb_conn.Close();
}
}
}

whengjun 2007-06-12
  • 打赏
  • 举报
回复
JF
加载更多回复(8)

62,074

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧