Hello Code project members. I'm new to C++ and I want to make a software that does these steps:
1- Makes Downloads Directory.
2- Downloads text file that has name of files.
3- Moves the text file to the "Downloads" folder.
4- Reads the files names from the text file then downloads them.
*I've been searching for codes to make new folders and moving files ..etc, and I came across of system commands that can be used.
using namespace std;
#pragma comment(lib, "urlmon.lib")
cout << "Welcome to Latest Files downloader, this software will let you download the lastest Files added\nFirst I'll make download folder for you\n";
std::string s1 = "mkdir \Downloads\ ";
cout << "\nDownloads folder created, now let me check the latest releases...\n";
HRESULT hr = URLDownloadToFile(NULL, _T("http://example.com/latest.txt"), _T("Latest.txt"), 0, NULL);
std::string s2 = "move latest.txt \Downloads";
The Code above does the two first steps, the file "Latest.txt" will have information like img1.png or video.mp4 which represents the name of files inside the directory.
I want the program to replace the names of files here:
*instead of "http://example.com/latest.txt" I want it automatically to change to "http://example.com/img1.png" and "http://example.com/vid1.mp4" just like the name of files that written in the text file.
your help will be appreciated!!
*I'm using windows by the way.