过滤网页中的HTML标签C++代码
来源:互联网 发布:利用单片机制作恒流源 编辑:程序博客网 时间:2024/06/05 16:42
#include<iostream>#include<fstream>#include<string>#include<stdlib.h>using namespace std;int Filter(string infile,string outfile){char character;bool text_state(true);//string infile,outfile;ifstream html;ofstream htmltext;//cout<<"The name of input file"<<endl;//cin>>infile;//cout<<"The name of output file"<<endl;//cin>>outfile;html.open(infile.c_str());if(html.fail()){ cerr<<"Error opening input file\n"; exit(1); }htmltext.open(outfile.c_str());html.get(character);while(!html.eof()){ if(text_state) { if(character=='<') text_state=false; else htmltext<<character; } else { if(character=='>') text_state=true; } html.get(character); }html.close();htmltext.close();return 0; } int main(){ string infile,outfile; cout<<"The name of input file"<<endl; cin>>infile; cout<<"The name of output file"<<endl; cin>>outfile; Filter(infile,outfile); system("pause"); return 0; }
0 0
- 过滤网页中的HTML标签C++代码
- c#过滤HTML 中的标签代码
- 网页预览 html过滤标签
- js 过滤html标签代码
- objective-c过滤HTML标签
- java+Jsoup 正则过滤html网页标签
- 正则表达式过滤网页中的标签
- php 过滤html标签的函数代码
- 过滤内容中的HTML标签 strip_tags
- python 过滤文本中的HTML标签
- python过滤html文档中的Tag标签
- kindeditor html代码过滤(丢失某些HTML标签)
- 网页HTML代码中Meta标签详解
- 网页HTML代码中Meta标签详解
- 网页制作HTML基础标签代码大全
- 网页HTML代码中Meta标签详解
- 网页HTML代码中Meta标签详解
- 如何过滤掉字符串中的html代码
- eclipse c++ && centos && error multiple errors reported. failed to execute mi command
- iOS 程序启动过程原理(一)
- oracle数据库监控与压力测试方法
- Android 图片处理工具类封装2
- Tomcat服务器的介绍以及配置、使用
- 过滤网页中的HTML标签C++代码
- 使用Spring进行面向切面编程(AOP)
- C++链表
- OpenGL_Qt学习笔记之_01(创建一个OpenGL窗口)
- C语言词法分析器
- 程序猿从不缺对象,想要随时可以new出来一个
- 自动加载的iframe高度自适应
- POJ - 2479 Maximum sum
- AngularJS 2.0 尝鲜