把word转换成html然后读取html内容到aspx页固定位置??

解决方案 »

  1.   

    如何把word转换成html然后读取html内容到aspx页固定位置??   没人那就明天来咯.....
      

  2.   


    建议看看Response输出流知识,实际传输过程都是二进制数据,只是在显示时转换器转换.
      

  3.   

    分三步:1、在服务端把word转化为html文件;
            2、获取页面的html代码 示例如下:
                   /// 获取html页面的html代码 
            /// </summary>
            /// <param name="Url">源网址</param>
            /// <returns>返回html代码</returns>
            public string GetHttpData(string Url)
            {
                string sException = null;
                string sRslt = null;
                WebResponse oWebRps = null;
                WebRequest oWebRqst = WebRequest.Create(Url);
                oWebRqst.Timeout = 50000;
                try
                {
                    oWebRps = oWebRqst.GetResponse();
                }
                catch (WebException e)
                {
                    sException = e.Message.ToString();
                    MessageBox.Show(sException);
                }
                catch (Exception e)
                {
                    sException = e.ToString();
                    MessageBox.Show(sException);
                }
                finally
                {
                    if (oWebRps != null)
                    {
                        StreamReader oStreamRd = new StreamReader(oWebRps.GetResponseStream(), Encoding.GetEncoding("GB2312"));
                        sRslt = oStreamRd.ReadToEnd();
                        oStreamRd.Close();
                        oWebRps.Close();
                    }
                }
                return sRslt;
            }
            3、控件赋值即可显示htm代码