我搜索了好久,就是没有找到!谢谢。

解决方案 »

  1.   

    BOOL StripTags(LPTSTR pszBuffer,LPTSTR pszTitle)
    {
    static BOOL bInTag = FALSE;
    LPTSTR pszSource=NULL;
    pszSource = strstr(pszBuffer,"<BODY");//pszBuffer;
    if(pszSource==NULL) 
    pszSource = strstr(pszBuffer,"<body");//pszBuffer;
    if(pszSource==NULL)
    return FALSE;
    LPTSTR title_begin=strstr(pszBuffer,"<TITLE>");
    if(title_begin==NULL)
    title_begin=strstr(pszBuffer,"<title>");
    if(title_begin==NULL||title_begin>pszSource)
    return FALSE;
    LPTSTR title_end=strstr(title_begin,"</");
    strncpy(pszTitle,title_begin+7,title_end-title_begin-7);
    pszTitle[title_end-title_begin-7]=0;
    LPTSTR pszDest = pszBuffer; while (*pszSource != '\0')
    {
    if (bInTag)
    {
    if (*pszSource == '>')
    bInTag = FALSE;
    pszSource++;
    }
    else
    {
    if (*pszSource == '<')
    bInTag = TRUE;
    else
    {
    *pszDest = *pszSource;
    pszDest++;
    }
    pszSource++;
    }
    }
    *pszDest = '\0';
    return TRUE;
    }
      

  2.   

    我做了一个 文本文件<==>HTML文件 互相转换的程序,留下email地址,我将VC源码发给你。
      

  3.   

    wmrwinhap(边城浪子):
    [email protected]
    thank you!
      

  4.   

    请给我一份好吗?
    我一直在寻找,
    就是没找到。
    [email protected]十分谢谢
      

  5.   

    到w3c.org上下载libHTML,里面有关于html parse的方法,基本上是创建一个有限状态机,来分析html的tag和attribute,见SGML_Write函数
      

  6.   

    如果是用 MFC 的 HtmlView 就简单了,几行代码就可以搞定
    #include <Mshtml.h>
    #include <atlbase.h>CComQIPtr<IHTMLDocument2,&IID_IHTMLDocument2> pDoc(GetHtmlDocument());
    CComQIPtr<IHTMLElement> pBody;
    pDoc->get_body(&pBody);
    CComBSTR bstr;
    pBody->get_innerText(&bstr);
    CString strText(bstr);
    MessageBox(strText);
      

  7.   

    给我一份
    [email protected]
      

  8.   

    See the links below: http://www.codeproject.com/cpp/stlxmlparser.asp
    http://www.codeproject.com/soap/paramio.asp