asp.net ajax 2.0/3.5 中的 html 编辑器

发布于 2024-10-08 03:27:58 字数 72 浏览 0 评论 0原文

我可以使asp.net ajax 2.0/3.5的html编辑器从目录中读取rtf文件吗?

如果可以的话我可以吗?

can i make html editor of asp.net ajax 2.0/3.5 to read a rtf file from a directory?

can i if yes then how please?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

撩心不撩汉 2024-10-15 03:27:58

是的,首先;读取文件内容。

// Specify file.
FileStream file = new FileStream(Server.MapPath("~\\files\\test.rtf"), FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(file);

// Read contents of file into a string
string cval = sr.ReadToEnd();

// Second; Set Content property of HTMLEditor.
htmlEditor.Content = cval;

// Close StreamReader
sr.Close();

// Close file
file.Close();

Yes, first; read file content.

// Specify file.
FileStream file = new FileStream(Server.MapPath("~\\files\\test.rtf"), FileMode.OpenOrCreate, FileAccess.Read);
StreamReader sr = new StreamReader(file);

// Read contents of file into a string
string cval = sr.ReadToEnd();

// Second; Set Content property of HTMLEditor.
htmlEditor.Content = cval;

// Close StreamReader
sr.Close();

// Close file
file.Close();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文