我的数据库中存着这样一段代码:<html>
<head>
<style>
<!--
 p.MsoNormal
{mso-style-parent:"";
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Times New Roman";
margin-left:0cm; margin-right:0cm; margin-top:0cm}
-->
</style>
</head>
<body>
<p class="MsoNormal" style="text-indent:21.75pt">
<span lang="EN-US" style="font-size:14.0pt">able</span><span style="font-size: 14.0pt; font-family: 宋体">/</span><span lang="EN-US" style="font-size:14.0pt">'eibl</span><span style="font-size: 14.0pt; font-family: 宋体">/</span></p>
<p class="MsoNormal" style="text-indent:21.75pt">
<span lang="EN-US" style="font-size:14.0pt">n. </span>
<span style="font-size: 14.0pt; font-family: 宋体">有能力的:能干的</span></p>
<p class="MsoNormal" style="text-indent:21.75pt">
<span lang="EN-US" style="font-size:14.0pt">be able to do sth</span><span style="font-size: 14.0pt; font-family: 宋体">.有能力干某事:能干某事</span></p>
<p class="MsoNormal" style="text-indent: 35.7pt; margin-left: 21.0pt">
<span lang="EN-US" style="font-size:14.0pt">From these facts I was &nbsp;able to tell 
what goods the animal was carrying</span><span style="font-size: 14.0pt; font-family: 宋体">.我从这些事实就能说出这头牲口</span><span lang="EN-US" style="font-size:14.0pt">121</span><span style="font-size: 14.0pt; font-family: 宋体">驮的是什么货.</span></p>
<p class="MsoNormal" style="text-indent:21.75pt">
<span lang="EN-US" style="font-size:14.0pt">&nbsp;</span><span style="font-size: 14.0pt; font-family: 宋体">反义词:</span><span lang="EN-US" style="font-size:14.0pt">unable(</span><span style="font-size: 14.0pt; font-family: 宋体">不能的,无能力的</span><span lang="EN-US" style="font-size:14.0pt">)</span></p>
<p class="MsoNormal" style="text-indent: -35.0pt; margin-left: 56.75pt">
<span lang="EN-US" style="font-size:14.0pt">&nbsp;</span><span style="font-size: 14.0pt; font-family: 宋体">注:</span><span lang="EN-US" style="font-size:14.0pt">1)be 
able</span><span style="font-size: 14.0pt; font-family: 宋体">和</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">的比较:表示能力时,</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">和</span><span lang="EN-US" style="font-size:14.0pt">be 
able</span><span style="font-size: 14.0pt; font-family: 宋体">可以交替使用.</span><span lang="EN-US" style="font-size:14.0pt">be 
able</span><span style="font-size: 14.0pt; font-family: 宋体">在现在时和过去时中可以代替</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">,并用来补充</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">所没有的形式.如现在时中可以用</span><span lang="EN-US" style="font-size:14.0pt">am(is</span><span style="font-size: 14.0pt; font-family: 宋体">,</span><span lang="EN-US" style="font-size:14.0pt">are)able</span><span style="font-size: 14.0pt; font-family: 宋体">或</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">,过去时中可以用</span><span lang="EN-US" style="font-size:14.0pt">was(were)able</span><span style="font-size: 14.0pt; font-family: 宋体">或</span><span lang="EN-US" style="font-size:14.0pt">could</span><span style="font-size: 14.0pt; font-family: 宋体">,而在将来时中则只能用</span><span lang="EN-US" style="font-size:14.0pt">will(shall)beable</span><span style="font-size: 14.0pt; font-family: 宋体">,因为</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">除了表示“许可”外,不能用于将来时。例如:</span><span lang="EN-US" style="font-size:14.0pt">1 
won't be able to see him today</span><span style="font-size: 14.0pt; font-family: 宋体">.我今天见不到他。</span></p>
<p class="MsoNormal" style="text-indent: 2.0cm">
<span lang="EN-US" style="font-size:14.0pt">2)</span><span style="font-size: 14.0pt; font-family: 宋体">参见</span><span lang="EN-US" style="font-size:14.0pt">can</span><span style="font-size: 14.0pt; font-family: 宋体">条.</span></p>
</body>
</html>我想把这段代码解析后显示在控件text1.text  或者在webbrowser控件中显示出来,
1.在vb中能实现这个功能吗>???
2.怎么实现?
拜托各位了  我真的搞不定了.

解决方案 »

  1.   

    uses 
      ActiveX; procedure WB_LoadHTML(WebBrowser: TWebBrowser; HTMLCode: string); 
    var 
      sl: TStringList; 
      ms: TMemoryStream; 
    begin 
      WebBrowser.Navigate('about:blank'); 
      while WebBrowser.ReadyState < READYSTATE_INTERACTIVE do 
       Application.ProcessMessages;   if Assigned(WebBrowser.Document) then 
      begin 
        sl := TStringList.Create; 
        try 
          ms := TMemoryStream.Create; 
          try 
            sl.Text := HTMLCode; 
            sl.SaveToStream(ms); 
            ms.Seek(0, 0); 
            (WebBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(ms)); 
          finally 
            ms.Free; 
          end; 
        finally 
          sl.Free; 
        end; 
      end; 
    end;
      

  2.   

    把这些数据保存到一个临时的.htm文件中,然后在webbrowser中显示就可以了,不用那么麻烦。
      

  3.   

    同意 roger_xiong(卖女孩的小火柴~)的方法
    自己解释html太累了
      

  4.   

    你的纯粹是HTML文件,哪有程序脚本,交给IE是最简单的,自己写解释程序并显示?太难了,可不只是太累的问题。
      

  5.   

    在下感谢各位的意见。
       三 四楼的大哥.我是新手.见笑了.我现在有两个问题要问。    第一.怎么建立临时.htm文件。
        第二.怎么把数据送给临时文件。
        还望赐教!!!
             
      

  6.   

    用webbrowser控件,可以直接将内存中的HTML编辑显示到控件上,我的网站上有源码,不过是DELPHI的,你可以看看,原理都是一样的。====================
    免费的学习交流网站,欢迎大家访问!
    http://www.j2soft.cn/
      

  7.   

    天狼大哥,你的那段东西我都看了n遍了,就是用vb实现不了呀?
      我的手太底了.麻烦你用vb实现一下好吗??
       在下在这里先谢了!!!
      

  8.   

    把数据保存到一个临时的*.htm文件中
    然后用webbrowser中显示
      

  9.   

    第一.怎么建立临时.htm文件。
        第二.怎么把数据送给临时文件。
        还望赐教!!!
      

  10.   

    it's easy:
    'add the following codes to form1 with a webbrowser control and a commandbutton:
    'then copy your html codes to clipboardOption ExplicitPrivate Sub Command1_Click()
    WebBrowser1.Navigate2 ("about:blank")
    Do While WebBrowser1.ReadyState <> READYSTATE_COMPLETE
    DoEvents
    Loop
    With WebBrowser1.Document
    .Open
    .write Clipboard.GetText' 你可以写入任意HTML源文件,从剪切板读取是为了简化代码。可以将HTML格式编码存入资源文件,字符串,INI文件,文本文件都可以。
    .Close
    End With
    End Sub
      

  11.   

    不知你的HTML内容在数据库中如何保存,只要你能按字符串格式取出,上面的代码就能显示到WEBBROWSER中。