C++中文件的读取操作,如何读取多行数据,如何一个一个的读取数据
练习8.1:编写函数。接受一个istream&参数,返回值类型也是istream&。此函数必须从给定流中读取数据,直至遇到文件结束标识时停止。
- #include <iostream>
- #include <stdexcept>
- using std::istream;
- using std::cin;
- using std::cout;
- using std::cerr;
- using std::endl;
- using std::runtime_error;
- istream &f(istream &in)
- {
- int v;
- while(in >> v, !in.eof())
- {
- if(in.bad())
- throw runtime_error("IO Stream error.");
- if(in.fail())
- {
- cerr<<"Data error! Please try again."<<endl;
- in.clear();
- in.ignore(100, '\n');
- continue;
- }
- cout<< v <<endl;
- }
- in.clear();
- return in;
- }
- int main()
- {
- cout<<"Please input some numbers, enter Ctrl+Z to end"<<endl;
- f(cin);
- return 0;
- }
练习8.3:什么情况下,下面的while循环会终止?
while (cin >> i) /*. . .*/
遇到文件结束符,或者遇到了IO流错误或者读入了无效数据。
练习8.4:编写函数,以读模式打开一个文件,将其内容读入到一个string的vector中,将每一行作为一个独立的元素存于vector中。
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
using std::cout;
using std::endl;
using std::string;
using std::ifstream;
using std::cerr;
using std::vector; int main()
{
ifstream in("data.txt");
if(!in) {
cerr<<"Can't open the file."<<endl;
return -1;
} string line;
vector<string> words;
while(getline(in, line))
words.push_back(line); in.close(); vector<string>::const_iterator it = words.cbegin();
while (it != words.cend())
{
cout<< *it <<endl;
++it;
}
return 0;
}
练习8.5:重写上面的程序,将每个单词作为一个独立的元素进行存储。
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
using std::cout;
using std::endl;
using std::string;
using std::ifstream;
using std::cerr;
using std::vector; int main()
{
ifstream in("data.txt");
if(!in) {
cerr<<"Can't open the file."<<endl;
return -1;
} string line;
vector<string> words;
while(in >> line)
words.push_back(line); in.close(); vector<string>::const_iterator it = words.cbegin();
while (it != words.cend())
{
cout<< *it <<endl;
++it;
}
return 0;
}
练习8.6:重写7.1.1节的书店程序,从一个文件中读取交易记录。将文件名作为一个参数传递给main。
- #include <iostream>
- #include <fstream>
- #include "Sales_data.h"
- using std::cout;
- using std::cerr;
- using std::ifstream;
- using std::endl;
- int main(int argc, char *argv[])
- {
- if (argc != 2) {
- cerr<< "Please give the file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if (!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- Sales_data total;
- if (read(in, total)) {
- Sales_data trans;
- while(read(in ,trans)) {
- if(total.isbn() == trans.isbn())
- total.combine(trans);
- else {
- print(cout, total) << endl;
- total =trans;
- }
- }
- print(cout, total)<<endl;
- }
- else {
- cerr<<" No data?!"<<endl;
- }
- return 0;
- }
练习8.7:修改上一节的书店程序,将结果保存到一个文件中。将输出文件名作为第二个参数传递给main函数。
- #include <iostream>
- #include <fstream>
- #include "Sales_data.h"
- using std::cerr;
- using std::ifstream;
- using std::ofstream;
- using std::endl;
- int main(int argc, char *argv[])
- {
- if (argc != 3) {
- cerr<< "Please give the input file name and out file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if (!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- ofstream out(argv[2]);
- if (!out) {
- cerr<<"can't open output file."<<endl;
- return -1;
- }
- Sales_data total;
- if (read(in, total)) {
- Sales_data trans;
- while(read(in ,trans)) {
- if(total.isbn() == trans.isbn())
- total.combine(trans);
- else {
- print(out, total) << endl;
- total =trans;
- }
- }
- print(out, total)<<endl;
- }
- else {
- cerr<<" No data?!"<<endl;
- }
- return 0;
- }
练习8.8:修改上一题的程序,将结果追加到给定的文件末尾。对同一个输出文件,运行程序至少两次,检验数据是否得以保留。
- #include <iostream>
- #include <fstream>
- #include "Sales_data.h"
- using std::cerr;
- using std::ifstream;
- using std::ofstream;
- using std::endl;
- int main(int argc, char *argv[])
- {
- if (argc != 3) {
- cerr<< "Please give the input file name and out file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if (!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- ofstream out(argv[2], ofstream::app);
- if (!out) {
- cerr<<"can't open output file."<<endl;
- return -1;
- }
- Sales_data total;
- if (read(in, total)) {
- Sales_data trans;
- while(read(in ,trans)) {
- if(total.isbn() == trans.isbn())
- total.combine(trans);
- else {
- print(out, total) << endl;
- total =trans;
- }
- }
- print(out, total)<<endl;
- }
- else {
- cerr<<" No data?!"<<endl;
- }
- return 0;
- }
练习8.3.1:使用你为8.1.2节第一个练习所编写的函数打印一个istringstream对象的内容。
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <stdexcept>
- using std::istream;
- using std::ostringstream;
- using std::istringstream;
- using std::string;
- using std::cout;
- using std::cerr;
- using std::endl;
- using std::runtime_error;
- istream &f(istream &in)
- {
- int v;
- while(in >> v, !in.eof())
- {
- if(in.bad())
- throw runtime_error("IO Stream error.");
- if(in.fail())
- {
- cerr<<"Data error! Please try again."<<endl;
- in.clear();
- in.ignore(100, '\n');
- continue;
- }
- cout<< v <<endl;
- }
- in.clear();
- return in;
- }
- int main()
- {
- ostringstream msg;
- msg<<"C++ Primer 5th edition"<<endl;
- istringstream in(msg.str());
- f(in);
- return 0;
- }
练习8.10:编写程序,将来自一个文件中的行保存在一个vector<string>中。然后使用一个istringstream从vector读取数据元素,每次读取一个单词。
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <string>
- #include <vector>
- using std::cerr;
- using std::endl;
- using std::cout;
- using std::ifstream;
- using std::istringstream;
- using std::string;
- using std::vector;
- int main()
- {
- ifstream in("Data.txt");
- if (!in) {
- cerr<<" Can't open input file."<<endl;
- return -1;
- }
- string line;
- vector<string> words;
- while (getline(in, line)) {
- words.push_back(line);
- }
- in.close();
- vector<string>::const_iterator it = words.begin();
- while( it != words.end()) {
- istringstream line_str(*it);
- string word;
- while(line_str >> word)
- cout<< endl;
- ++it;
- }
- return 0;
- }
练习8.11:本节的程序在外层while循环中定义了istringstream对象。如果record对象定义在循环之外,你需要对程序进行怎么样的修改?重写程序,将record的定义移到while循环之外,验证你设想的修改方法是否正确。
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- using std::cin;
- using std::istringstream;
- using std::string;
- using std::vector;
- struct PersonInfo {
- string name;
- vector<string> phones;
- };
- int main()
- {
- string line, word;
- vector<PersonInfo> people;
- istringstream record;
- while (getline(cin,line)) {
- PersonInfo info;
- record.clear();
- record.str(line);
- record >> info.name;
- while (record >> word)
- info.phones.push_back(word);
- people.push_back(info);
- }
- return 0;
- }
练习8.12:我们为什么没有在PersonInfo中使用类内初始化?
由于每个人的电话号数量不固定,因此更好的方式不是通过类内初始化指定人名和所有电话号码,而是在缺省初始化之后,在程序中设置人名并逐个添加电话号码。
练习8.13:重写本节的电话号码程序,从一个命名文件而非cin读取数据。
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <string>
- #include <vector>
- using std::cerr;
- using std::endl;
- using std::cout;
- using std::ifstream;
- using std::istringstream;
- using std::ostringstream;
- using std::string;
- using std::vector;
- struct PersonInfo {
- string name;
- vector<string> phones;
- };
- string format(const string &s) { return s; }
- bool valid(const string &s)
- {
- return true;
- }
- int main(int argc, char *argv[])
- {
- string line, word;
- vector<PersonInfo> people;
- istringstream record;
- if (argc != 2) {
- cerr<<"Please give the file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if(!in)
- {
- cerr<<"can't open input file"<<endl;
- return -1;
- }
- while (getline(in, line)) {
- PersonInfo info;
- record.clear();
- record.str(line);
- record >> info.name;
- while(record >> word)
- info.phones.push_back(word);
- people.push_back(info);
- }
- ostringstream os;
- for (const auto &entry : people) {
- ostringstream formatted, badNums;
- for(const auto &nums : entry.phones) {
- if (!valid(nums)) {
- badNums << " "<< nums;
- }
- else
- formatted << " " <<format(nums);
- }
- if (badNums.str().empty())
- os <<entry.name<<" "<<formatted.str()<<endl;
- else
- cerr<<"input error: "<<entry.name<<" invalid number(s) "<<badNums.str()<<endl;
- }
- cout<<os.str()<<endl;
- return 0;
- }
练习8.14:我们为什么将entry和nums定义为const auto&?
这两条语句分别适用范围for语句枚举people中所有项和每项的phones中的所有项。使用const表明在循环中不会改变这些项的值;auto是请求编译器依据vector元素类型来推断出entry和nums的类型,既简化代码又避免出错;使用引用的原因是,people和phones的元素分别是结构对象和字符串对象,使用引用即可避免对象拷贝。
版权声明:本文为博主原创文章,未经博主允许不得转载。
顶2
踩0
练习8.1:编写函数。接受一个istream&参数,返回值类型也是istream&。此函数必须从给定流中读取数据,直至遇到文件结束标识时停止。
- #include <iostream>
- #include <stdexcept>
- using std::istream;
- using std::cin;
- using std::cout;
- using std::cerr;
- using std::endl;
- using std::runtime_error;
- istream &f(istream &in)
- {
- int v;
- while(in >> v, !in.eof())
- {
- if(in.bad())
- throw runtime_error("IO Stream error.");
- if(in.fail())
- {
- cerr<<"Data error! Please try again."<<endl;
- in.clear();
- in.ignore(100, '\n');
- continue;
- }
- cout<< v <<endl;
- }
- in.clear();
- return in;
- }
- int main()
- {
- cout<<"Please input some numbers, enter Ctrl+Z to end"<<endl;
- f(cin);
- return 0;
- }
练习8.3:什么情况下,下面的while循环会终止?
while (cin >> i) /*. . .*/
遇到文件结束符,或者遇到了IO流错误或者读入了无效数据。
练习8.4:编写函数,以读模式打开一个文件,将其内容读入到一个string的vector中,将每一行作为一个独立的元素存于vector中。
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <vector>
- using std::cout;
- using std::endl;
- using std::string;
- using std::ifstream;
- using std::cerr;
- using std::vector;
- int main()
- {
- ifstream in("data.txt");
- if(!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- string line;
- vector<string> words;
- while(getline(in, line))
- words.push_back(line);
- in.close();
- vector<string>::const_iterator it = words.cbegin();
- while (it != words.cend())
- {
- cout<< *it <<endl;
- ++it;
- }
- return 0;
- }
练习8.5:重写上面的程序,将每个单词作为一个独立的元素进行存储。
- #include <iostream>
- #include <string>
- #include <fstream>
- #include <vector>
- using std::cout;
- using std::endl;
- using std::string;
- using std::ifstream;
- using std::cerr;
- using std::vector;
- int main()
- {
- ifstream in("data.txt");
- if(!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- string line;
- vector<string> words;
- while(in >> line)
- words.push_back(line);
- in.close();
- vector<string>::const_iterator it = words.cbegin();
- while (it != words.cend())
- {
- cout<< *it <<endl;
- ++it;
- }
- return 0;
- }
练习8.6:重写7.1.1节的书店程序,从一个文件中读取交易记录。将文件名作为一个参数传递给main。
- #include <iostream>
- #include <fstream>
- #include "Sales_data.h"
- using std::cout;
- using std::cerr;
- using std::ifstream;
- using std::endl;
- int main(int argc, char *argv[])
- {
- if (argc != 2) {
- cerr<< "Please give the file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if (!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- Sales_data total;
- if (read(in, total)) {
- Sales_data trans;
- while(read(in ,trans)) {
- if(total.isbn() == trans.isbn())
- total.combine(trans);
- else {
- print(cout, total) << endl;
- total =trans;
- }
- }
- print(cout, total)<<endl;
- }
- else {
- cerr<<" No data?!"<<endl;
- }
- return 0;
- }
练习8.7:修改上一节的书店程序,将结果保存到一个文件中。将输出文件名作为第二个参数传递给main函数。
- #include <iostream>
- #include <fstream>
- #include "Sales_data.h"
- using std::cerr;
- using std::ifstream;
- using std::ofstream;
- using std::endl;
- int main(int argc, char *argv[])
- {
- if (argc != 3) {
- cerr<< "Please give the input file name and out file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if (!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- ofstream out(argv[2]);
- if (!out) {
- cerr<<"can't open output file."<<endl;
- return -1;
- }
- Sales_data total;
- if (read(in, total)) {
- Sales_data trans;
- while(read(in ,trans)) {
- if(total.isbn() == trans.isbn())
- total.combine(trans);
- else {
- print(out, total) << endl;
- total =trans;
- }
- }
- print(out, total)<<endl;
- }
- else {
- cerr<<" No data?!"<<endl;
- }
- return 0;
- }
练习8.8:修改上一题的程序,将结果追加到给定的文件末尾。对同一个输出文件,运行程序至少两次,检验数据是否得以保留。
- #include <iostream>
- #include <fstream>
- #include "Sales_data.h"
- using std::cerr;
- using std::ifstream;
- using std::ofstream;
- using std::endl;
- int main(int argc, char *argv[])
- {
- if (argc != 3) {
- cerr<< "Please give the input file name and out file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if (!in) {
- cerr<<"Can't open the file."<<endl;
- return -1;
- }
- ofstream out(argv[2], ofstream::app);
- if (!out) {
- cerr<<"can't open output file."<<endl;
- return -1;
- }
- Sales_data total;
- if (read(in, total)) {
- Sales_data trans;
- while(read(in ,trans)) {
- if(total.isbn() == trans.isbn())
- total.combine(trans);
- else {
- print(out, total) << endl;
- total =trans;
- }
- }
- print(out, total)<<endl;
- }
- else {
- cerr<<" No data?!"<<endl;
- }
- return 0;
- }
练习8.3.1:使用你为8.1.2节第一个练习所编写的函数打印一个istringstream对象的内容。
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <stdexcept>
- using std::istream;
- using std::ostringstream;
- using std::istringstream;
- using std::string;
- using std::cout;
- using std::cerr;
- using std::endl;
- using std::runtime_error;
- istream &f(istream &in)
- {
- int v;
- while(in >> v, !in.eof())
- {
- if(in.bad())
- throw runtime_error("IO Stream error.");
- if(in.fail())
- {
- cerr<<"Data error! Please try again."<<endl;
- in.clear();
- in.ignore(100, '\n');
- continue;
- }
- cout<< v <<endl;
- }
- in.clear();
- return in;
- }
- int main()
- {
- ostringstream msg;
- msg<<"C++ Primer 5th edition"<<endl;
- istringstream in(msg.str());
- f(in);
- return 0;
- }
练习8.10:编写程序,将来自一个文件中的行保存在一个vector<string>中。然后使用一个istringstream从vector读取数据元素,每次读取一个单词。
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <string>
- #include <vector>
- using std::cerr;
- using std::endl;
- using std::cout;
- using std::ifstream;
- using std::istringstream;
- using std::string;
- using std::vector;
- int main()
- {
- ifstream in("Data.txt");
- if (!in) {
- cerr<<" Can't open input file."<<endl;
- return -1;
- }
- string line;
- vector<string> words;
- while (getline(in, line)) {
- words.push_back(line);
- }
- in.close();
- vector<string>::const_iterator it = words.begin();
- while( it != words.end()) {
- istringstream line_str(*it);
- string word;
- while(line_str >> word)
- cout<< endl;
- ++it;
- }
- return 0;
- }
练习8.11:本节的程序在外层while循环中定义了istringstream对象。如果record对象定义在循环之外,你需要对程序进行怎么样的修改?重写程序,将record的定义移到while循环之外,验证你设想的修改方法是否正确。
- #include <iostream>
- #include <sstream>
- #include <string>
- #include <vector>
- using std::cin;
- using std::istringstream;
- using std::string;
- using std::vector;
- struct PersonInfo {
- string name;
- vector<string> phones;
- };
- int main()
- {
- string line, word;
- vector<PersonInfo> people;
- istringstream record;
- while (getline(cin,line)) {
- PersonInfo info;
- record.clear();
- record.str(line);
- record >> info.name;
- while (record >> word)
- info.phones.push_back(word);
- people.push_back(info);
- }
- return 0;
- }
练习8.12:我们为什么没有在PersonInfo中使用类内初始化?
由于每个人的电话号数量不固定,因此更好的方式不是通过类内初始化指定人名和所有电话号码,而是在缺省初始化之后,在程序中设置人名并逐个添加电话号码。
练习8.13:重写本节的电话号码程序,从一个命名文件而非cin读取数据。
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <string>
- #include <vector>
- using std::cerr;
- using std::endl;
- using std::cout;
- using std::ifstream;
- using std::istringstream;
- using std::ostringstream;
- using std::string;
- using std::vector;
- struct PersonInfo {
- string name;
- vector<string> phones;
- };
- string format(const string &s) { return s; }
- bool valid(const string &s)
- {
- return true;
- }
- int main(int argc, char *argv[])
- {
- string line, word;
- vector<PersonInfo> people;
- istringstream record;
- if (argc != 2) {
- cerr<<"Please give the file name."<<endl;
- return -1;
- }
- ifstream in(argv[1]);
- if(!in)
- {
- cerr<<"can't open input file"<<endl;
- return -1;
- }
- while (getline(in, line)) {
- PersonInfo info;
- record.clear();
- record.str(line);
- record >> info.name;
- while(record >> word)
- info.phones.push_back(word);
- people.push_back(info);
- }
- ostringstream os;
- for (const auto &entry : people) {
- ostringstream formatted, badNums;
- for(const auto &nums : entry.phones) {
- if (!valid(nums)) {
- badNums << " "<< nums;
- }
- else
- formatted << " " <<format(nums);
- }
- if (badNums.str().empty())
- os <<entry.name<<" "<<formatted.str()<<endl;
- else
- cerr<<"input error: "<<entry.name<<" invalid number(s) "<<badNums.str()<<endl;
- }
- cout<<os.str()<<endl;
- return 0;
- }
练习8.14:我们为什么将entry和nums定义为const auto&?
这两条语句分别适用范围for语句枚举people中所有项和每项的phones中的所有项。使用const表明在循环中不会改变这些项的值;auto是请求编译器依据vector元素类型来推断出entry和nums的类型,既简化代码又避免出错;使用引用的原因是,people和phones的元素分别是结构对象和字符串对象,使用引用即可避免对象拷贝。
版权声明:本文为博主原创文章,未经博主允许不得转载。
顶2
踩0
C++中文件的读取操作,如何读取多行数据,如何一个一个的读取数据的更多相关文章
- kernel中文件的读写操作可以使用vfs_read()和vfs_write
需要在Linux kernel--大多是在需要调试的驱动程序--中读写文件数据.在kernel中操作文件没有标准库可用,需要利用kernel的一些函数,这些函数主要有: filp_open() fil ...
- (六)kernel中文件的读写操作可以使用vfs_read()和vfs_write
需要在Linux kernel--大多是在需要调试的驱动程序--中读写文件数据.在kernel中操作文件没有标准库可用,需要利用kernel的一些函数,这些函数主要有: filp_open() fil ...
- linux中文件I/O操作(系统I/O)
我们都知道linux下所有设备都是以文件存在的,所以当我们需要用到这些设备的时候,首先就需要打开它们,下面我们来详细了解一下文件I/O操作. 用到的文件I/O有以下几个操作:打开文件.读文件.写文件. ...
- Python中文件的读写操作
文件操作基本流程: 1. 介绍 计算机系统是由计算机硬件,操作系统,和应用程序三部分组成. 内存 存放不持久 硬盘 可以使数据持久化 文件操作 数据持久化的一种 全栈开发 框架类 2. 文件的操作 ...
- Python中文件路径名的操作
1 文件路径名操作 对于文件路径名的操作在编程中是必不可少的,比如说,有时候要列举一个路径下的文件,那么首先就要获取一个路径,再就是路径名的一个拼接问题,通过字符串的拼接就可以得到一个路径名.Pyth ...
- 『无为则无心』Python基础 — 41、Python中文件的读写操作(一)
目录 1.文件操作步骤 2.文件的读写操作 (1)文件的打开 (2)打开文件模式 (3)获取一个文件对象 (4)关于文件路径 1.文件操作步骤 当我们要读取或者写入文件时,我们需要打开文件,在操作完毕 ...
- 『无为则无心』Python基础 — 42、Python中文件的读写操作(二)
目录 (5)文件对象方法(重点) 1)写方法 2)读方法 3)seek()方法 4)tell()方法 (6)关闭 (7)综合练习:读取大文件 (5)文件对象方法(重点) 1)写方法 @1.语法 对象对 ...
- python中文件的基础操作
打开文件的三种方式: open(r'E:\学习日记\python\code\文件的简单操作.py') open('E:\\学习日记\\python\\code\\文件的简单操作.py') open(' ...
- python 中文件夹的操作
文件有两个管家属性:路径和文件名. 路径指明了文件在磁盘的位置,文件名原点的后面部分称为扩展名(后缀),它指明了文件的类型. 一:文件夹操作 Python中os 模块可以处理文件夹 1,当前工作目录 ...
- Python中文件的读写操作的几种方法
对文件的操作,步骤为:打开一个文件-->读取/写入内容-->保存文件 文件读写的3中模式 # 1.w 写模式,它是不能读的,如果用w模式打开一个已经存在的文件,会清空以前的文件内容,重新写 ...
随机推荐
- Django框架之ORM的相关操作之多对多三种方式(五)
在之前的博客中已经讲述了使用ORM的多对多关系表,现在进行总结一下: 1.ORM自动帮助我们创建第三张表 2.手动创建第三张表,第三张表使用ForeignKey指向其他的两张表关联起来 3.手动创建第 ...
- lca最近公共祖先与树上倍增。
https://vjudge.net/contest/295298#problem/A lca 的题目 求任意两点的距离. A题是在线算法,用st表rmq来实现. https://blog.csdn. ...
- 创业学习---《如何展开竞争情报调研》--D-1.调研模块---HHR计划---以太一堂
第一:<开始学习> 1,投资人看人标准:人品好:创业热情:学习能力. 2,思考题:请你预判一个最靠谱的方向来创业,你会怎么调研呢? 3,预热思考题: (1)在这个赛道,究竟有哪些重要竞争对 ...
- 4 中文乱码 selenium的使用
# 中文乱码 #处理中文乱码 import requests from lxml import etree from urllib import request url = 'http://pic.n ...
- springboot学习4使用日志:logback
springboot学习4使用日志:logback 一.基本知识说明 SpringBoot默认使用logback作为日志框架 ,所以引入起步依赖后就可以直接使用logback,不需要其他依赖. Spr ...
- 从 0 到 1:Apache APISIX 的 Apache 之路
2019 年 12 月 14 日,又拍云联合 Apache APISIX 社区举办 API 网关与高性能服务最佳实践丨Open Talk 广州站活动,本次活动,邀请了来自Apache APISIX.又 ...
- Python - 静态方法@staticmethod和类方法classmethod
传送门 https://github.com/jackfrued/Python-100-Days/blob/master/Day01-15/Day09/%E9%9D%A2%E5%90%91%E5%AF ...
- C# 集合类型学习
如果你掌握了一门语言的数据结构 ,那么你离掌握这门语言 也不远了 1.列表 对于list,值得一提的是 Capacity 属性,使用默认的构造函数 ,让我们用代码来说明 var intList = n ...
- buuctf——facebook1
分为注册和登陆两个页面 据大佬wp登陆页面又盲注,但我没测试 直接注册后登陆 注册后发现,会显示输入的url 根据目录扫描,发现robots.txt和flag.php robots.txt有源码备份 ...
- 无刷新的批量图片上传插件.NET版
啥都不说,先上效果图: 这是一个网上的第三方组件,原版是php的,我用.NET重写了图片上传的处理,下面贴上代码 using System; using System.Collections.Gene ...