

























在c#程序中展示嵌入的RTF文件是相当容易的--在Windows表单的富文本控件里(RichTextControl).
首先,添加一下引用:
1 using System.IO;
2 using System.Reflection;
其次,加载这个你嵌入到你项目中的RTF文件。
1
Assembly asm = Assembly.GetExecutingAssembly();
2
Stream stream = asm.GetManifestResourceStream( "MyNamespace.FileName.rtf" );
3 RichTextBox rt = new RichTextBox();
4 rt.LoadFile( stream, RichTextBoxStreamType.RichText );
在这里加载嵌入的资源文件最重要就是得到正确的路径。
posted @ 2008-07-24 10:50 Lucky Jack 阅读(929) 评论(0) 收藏 举报
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。