c#问题 如何用C#将word文档读取到richtextbox中,并保存到word中? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string fileName = Request.PhysicalApplicationPath.ToString() + this.filepath.Replace(@"\", @"\\") + @"mm\" + this.ddlType.SelectedValue + ".htm";//路径 FileStream fs = new FileStream(@fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);//如果文件不存在的话,新建一个。存在的话,直接写入。 StreamWriter writer = new StreamWriter(fs, System.Text.Encoding.GetEncoding("GB2312")); writer.WriteLine(HttpUtility.HtmlDecode(this.txtContent.Text.Trim())); writer.Close(); this.Page.RegisterStartupScript("alert", "<script language=javascript>alert('操作完成!');</script>"); 先把word文档装成RTF格式后richTextBox.LoadFile(strFileName,RichTextBoxStreamType.PlainText)Word.ApplicationClass wordApp=new ApplicationClass();object file=path;object nullobj=System.Reflection.Missing.Value; Word.Document doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);doc.ActiveWindow.Selection.WholeStory();doc.ActiveWindow.Selection.Copy();IDataObject data=Clipboard.GetDataObject();string str=data.GetData(DataFormats.Text).ToString();doc.Close(); C#获取JSON用LitJSON解析如下response。 我用BeginInvoke用错了,造成还是堵塞没形成异步 求一人帮我打包一下程序、 时有时无的问题! 已有与此命令相关联的 DataReader,必须首先将关闭 想知道数据库ID这种加密方式是怎么处理或怎么国密方式得来的。 急问,为什么用web用户控件做好的程序在ie6中第一次打开的时候会显示没有CSS控制的效果 请问如何实现这样的信息提示框? 人物照片,背景单色,如何使用.net框架,画出人物轮廓。 同一个.aspx页面中2个.ascx的互相调用问题 vs2005怎么没有bin文件夹呢? 购物车问题 多组数组同时发送问题
string fileName = Request.PhysicalApplicationPath.ToString() + this.filepath.Replace(@"\", @"\\") + @"mm\" + this.ddlType.SelectedValue + ".htm";//路径
FileStream fs = new FileStream(@fileName, FileMode.OpenOrCreate, FileAccess.ReadWrite);//如果文件不存在的话,新建一个。存在的话,直接写入。
StreamWriter writer = new StreamWriter(fs, System.Text.Encoding.GetEncoding("GB2312"));
writer.WriteLine(HttpUtility.HtmlDecode(this.txtContent.Text.Trim()));
writer.Close();
this.Page.RegisterStartupScript("alert", "<script language=javascript>alert('操作完成!');</script>");
richTextBox.LoadFile(strFileName,RichTextBoxStreamType.PlainText)
Word.ApplicationClass wordApp=new ApplicationClass();
object file=path;
object nullobj=System.Reflection.Missing.Value;
Word.Document doc = wordApp.Documents.Open(
ref file, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj,
ref nullobj, ref nullobj, ref nullobj);doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data=Clipboard.GetDataObject();
string str=data.GetData(DataFormats.Text).ToString();
doc.Close();