回复 36楼zzxzr的帖子
我这边可以正常加载二进制流文件:
- protected void Button1_Click(object sender, EventArgs e)
- {
- // open a document using a temporary instance of ServerTextControl
- // and save it into a byte array
- // load the document from the byte array into the Web editor
- using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
- {
- tx.Create();
- TXTextControl.LoadSettings ls = new TXTextControl.LoadSettings();
- ls.ApplicationFieldFormat = TXTextControl.ApplicationFieldFormat.MSWord;
- tx.Load(Server.MapPath("Test.doc"),
- TXTextControl.StreamType.MSWord, ls);
- byte[] data;
- tx.Save(out data, TXTextControl.BinaryStreamType.InternalUnicodeFormat);
- TextControl1.LoadText(data, TXTextControl.Web.BinaryStreamType.InternalUnicodeFormat);
- }
- }
复制代码
Demo:
tx_upload.zip
(210.37 KB, 下载次数: 406)
|