Jump to content

How to download from a list of links - Need help

- - - - -

  • Please log in to reply
2 replies to this topic

#1
alex1

alex1

    Learning Programmer

  • Members
  • PipPipPip
  • 93 posts
Hello guys... I'm really new in C coding and I need help :(

I'm working on a school project.I have to put downloadable urls into a txt file and then the program have to read the file and download them.Since we never talked about this in my school,I really can't know how to do this...
I need just the part of the code wich is reading the file and downloading the stuff(if possible)

Any help is precious for me!

THANKS in advance! :rolleyes:

---------- Post added at 01:58 AM ---------- Previous post was at 01:39 AM ----------

ok In c++ it should be somthing like that:
#include <windows.h>


void main()

{

   ShellExecute(NULL, "open", "http://URL.com",

                NULL, NULL, SW_SHOWNORMAL);

}


where I have to replace the URL.com with the file name..but I'm realy SUPER confused about this,because its unknown function and have no idea how exacly to moderate it...
Can someone help me? in C or C++ both are ok.

Thanks again

#2
Ancient Dragon

Ancient Dragon

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 400 posts
ShellExecute() is a MS-Windows API function and you can read all about it from this link

To see how it works run this simple console program

#include <windows.h>


int main(void)

{

   ShellExecute(NULL, "open", "http://www.codecall.net",

                NULL, NULL, SW_SHOWNORMAL);

}


Now all you have to do with the above is to add code that reads the lines from the text file and replace "http:..." with a character array or std::string that was read from the file.
Visit Grandpa's Forums, a social networking forum, with family-oriented arcade games, blogs, discussion forums, and photo albums.

#3
alex1

alex1

    Learning Programmer

  • Members
  • PipPipPip
  • 93 posts
THANK YOU!!! I found the solution!!!! :rolleyes:




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users