【问题标题】:html editor in asp.net ajax 2.0/3.5asp.net ajax 2.0/3.5 中的 html 编辑器
【发布时间】:2010-12-15 18:53:23
【问题描述】:

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

如果可以,请问怎么办?

【问题讨论】:

    标签: asp.net ajax ajaxcontroltoolkit ajax.net


    【解决方案1】:

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

    // 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();
    

    【讨论】:

    • ��ࡱ������������������>����������������������9 当我转换它向我展示了这种类型的数据,你能帮忙吗?我认为空间是用这种类型的 ascii 编码的
    • 什么时候转换?转换是什么意思?
    • 实际上文件首先在 docx 文件中我上传了文件并将其插入到 sql server 并在 rtf 文件中检索它然后我使用 html 编辑器并使用你的代码在 web 中显示它。
    • 所以,我认为不是 HTMLEditor 的问题,而是文件处理逻辑(word --> SQL Server --> rtf)。我不确切知道问题出在哪里,但它与文件转换有关。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-17
    • 1970-01-01
    • 2011-10-02
    相关资源
    最近更新 更多