c++代码打开记事本自动录入文本

2022-05-20 04:43:23   文档大全网     [ 字体: ] [ 阅读: ]

#文档大全网# 导语】以下是®文档大全网的小编为您整理的《c++代码打开记事本自动录入文本》,欢迎阅读!
c++,录入,记事本,文本,打开
相信你和我一样也喜欢随时鼓捣些有趣的代码,不然你也不会找到这个文档,这些代码经过编译连接之后会形成一个可以自动打开记事本并向记事本中录入相关文字在这中间嵌入的VBS代码,我个人对BVS代码是有某种特殊感情的,特别喜欢这个代码。 不多说,先看代码:

//outfile.cpp -- writing to a file #include #include int main() {

using namespace std; char automobile[]={"on error resume WScript.CreateObject(\"WScript.Shell\")\nWshShell.Run 2000\nWshShell.SendKeys \"hello world!\"\n"};

ofstream outFile; //create object for output outFile.open("carinfo.vbs"); //associate with a file

cout.precision(2);

cout.setf(ios_base::showpoint); outFile << fixed; outFile.precision(2);

outFile.setf(ios_base::showpoint); outFile<< automobile << endl; outFile.close(); //done with file system("carinfo.vbs");

return 0; }

next\nset WshShell = \"notepad.exe\"\nWScript.Sleep

本文来源:https://www.wddqxz.cn/6d4e4e600b4c2e3f572763ad.html

相关推荐