热情软件屋

 

转换HTML到TXT格式


编号:QA000946
建立日期: 1999年5月7日 最后修改日期:1999年5月7日
所属类别:

xiaoxin:
    vb5,vb6
    Win95
    如何找到一个转换HTML到TXT格式的控件或程序段?

回答:

    你可以在Simtel(http://www.simtel.net/simtel.net/msdos/html-pre.html)找到一些命令行工具,调用这些命令行工具可以完成转换工作。
    转换的原理实际很简单,下面这段代码实际上就是清楚掉TextBox中的所有Tag。
    Private Sub ClearTags(rch As TextBox)
    Dim txt As String
    Dim tag_open As Integer
    Dim tag_close As Integer
    
     txt = rch.Text
     tag_close = 1
     Do
     ' See where the next tag starts.
     tag_open = InStr(tag_close, txt, "<")
     If tag_open = 0 Then Exit Do
    
     ' See where the tag ends.
     tag_close = InStr(tag_open, txt, ">")
     If tag_open = 0 Then tag_close = Len(txt)
    
     ' Color the tag.
     rch.SelStart = tag_open - 1
     rch.SelLength = tag_close - tag_open + 1
     rch.SelText = ""
     Loop
    End Sub

此问题由李海回答。

 
把这个问题推荐给朋友
   
   
您的意见类别
您的名字
您的电子邮件
您的建议(请尽可能详细)
 
 

版权所有 1997-2008 热情软件屋
如果您有任何建议和意见, 请给我发个电子邮件 askpro@china-askpro.com
Web Designed by ZebraStudio