char b = (char)i;
char *text = "function make_page("+b+"){"
"var url = 'http://www.gigasena.com.br/loterias/mega-sena/resultados/resultado-mega-sena-'+"+b+"+'.htm';"
"var page = require('webpage').create();"
"var fs = require('fs');"
"page.open(url, function () {"
"page.evaluate(function(){"
""
"});"
"page.render('results/export-'+"+b+"+'.png');"
"fs.write('results/'+"+b+"+'.html', page.content, 'w');"
"phantom.exit();"
"});"
"}"
"make_page("+b+");";
Run Code Online (Sandbox Code Playgroud)
您不能在C++中添加字符串文字.如果您使用std::string对象,则可以执行以下操作:
int i = 'a';
char b = (char)i;
std::string text = std::string("function make_page(") + b + "){"
"var url = 'http://www.gigasena.com.br/loterias/mega-sena/resultados/resultado-mega-sena-'+" + b + "+'.htm';"
"var page = require('webpage').create();"
"var fs = require('fs');"
"page.open(url, function () {"
"page.evaluate(function(){"
""
"});"
"page.render('results/export-'+" + b + "+'.png');"
"fs.write('results/'+" + b + "+'.html', page.content, 'w');"
"phantom.exit();"
"});"
"}"
"make_page(" + b + ");";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5761 次 |
| 最近记录: |