高分相送,如何用客户端的word打开服务端的Word文档 <A HREF="HTTP://服务器名/路径/文件名.DOC">打开</A> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 按钮事件中加入:(选中记录中包含word非格式化数据)DataTable chooseItem_dt = chooseItem(); DataRow chooseDataLine = chooseItem_dt.Rows[0]; Session["FileType"] = "application/msword"; if (Session["sWord"] != null) Session.Remove("sWord"); Session["sWord"] = chooseDataLine["Unfordata"]; this.H_Error.Value = "hasWordData";该页面的html中加入:<% if (this.H_Error.Value=="hasWordData") %> <script language="javascript"> window.open("ShowWordFile.aspx"); </script>ShowWordFile.aspx德pageload中加入:private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 Response.Expires = 0; Response.ContentType = "application/msword"; Response.BinaryWrite((byte[])Session["sWord"]); Response.End(); } 你可以用一个连接指向一个DOC文档,你可以选择打开或保存。两种方式都可以打开DOC。 actually it's quite simple.Response.ContentType = "Application/x-msword"; string strFilePath=""; strFilePath ="d:\\Report.doc"; FileStream fs = new FileStream(strFilePath,FileMode.OpenOrCreate,FileAccess.Read); Response.WriteFile(strFilePath,0,fs.Length); fs.Close(); 返回为""谁帮我看下 Repeater 页面显示问题。 关于数据库 微软自带AJAX问题 修改客户端注册表 只剩下两个月的爱情! |M| 麻烦幕白兄,还是上次那个打印控件的问题:如何设置我那个控件的打印高度和宽度 未解决,有压力。。囧 能帮我看一个sql语句吗?strsql="select * from mytable where"& kind&" like'%"&keyword&"%'" asd 两个问题:VPC和Net Framework SP1 如何控制Dadagrid中的数据?
DataTable chooseItem_dt = chooseItem();
DataRow chooseDataLine = chooseItem_dt.Rows[0];
Session["FileType"] = "application/msword";
if (Session["sWord"] != null)
Session.Remove("sWord");
Session["sWord"] = chooseDataLine["Unfordata"];
this.H_Error.Value = "hasWordData";该页面的html中加入:
<% if (this.H_Error.Value=="hasWordData") %>
<script language="javascript">
window.open("ShowWordFile.aspx");
</script>
ShowWordFile.aspx德pageload中加入:
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
Response.Expires = 0;
Response.ContentType = "application/msword";
Response.BinaryWrite((byte[])Session["sWord"]);
Response.End();
}
string strFilePath="";
strFilePath ="d:\\Report.doc";
FileStream fs = new FileStream(strFilePath,FileMode.OpenOrCreate,FileAccess.Read);
Response.WriteFile(strFilePath,0,fs.Length);
fs.Close();