Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic (http://www.programmingforums.org/forum18.html)
-   -   Help please (http://www.programmingforums.org/showthread.php?t=6317)

747 Oct 7th, 2005 6:35 PM

Help please
 
Hey guy's im making a prog and it's simple but, i need the code line im not sure what it is, the program is when you click a commad button it will download a txt file to your desktop or hard drive for example a site like this will be in the coding www.wtfever.com/LOLROFL.txt --- it will download this text file to your desktop when you click the button help.. :)

crazykid48x Oct 7th, 2005 6:54 PM

that link doesnt work for me. What language are you using?

Silvanus Oct 7th, 2005 7:26 PM

Quote:

Originally Posted by crazykid48x
that link doesnt work for me. What language are you using?

Presumably Visual Basic.

@747: There are some of problems with this post. To enumerate:

1) The title: "Help Please" is not even remotely close to a good description of your topic.

2) You haven't shown the code you have. We can't help you get where you want to go unless we see where you're starting from.

You need to read the Forum Rules.

747 Oct 7th, 2005 8:32 PM

Ohh damn i forgot lol, vb.6 and heres a pic of the layout:
http://x10.putfile.com/10/27920290276.gif
So what i want to do is when i hit download takes the sites txt file that i put in and it saves it to my desktop.

I tried this didnt work it didnt download the file and it didnt save:
:

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
    "URLDownloadToFileA" ( ByVal pCaller As Long , ByVal szURL As String , _
    ByVal szFileName As String , ByVal dwReserved As Long , _
    ByVal lpfnCB As Long ) As Long

'this will download the file onto the local harddrive
Dim iReturn As Long
iReturn = URLDownloadToFile(0, " http://www.domain.com/filename.txt " , "c:\localfile.txt" , 0, 0)


ivan Oct 8th, 2005 2:09 AM

Are you crazy man? No hacking here! He said: "You need to read the Forum Rules."

!@#$%^&*)(*^&%^

747 Oct 8th, 2005 7:57 AM

Its not that type of hacking ps2hacking is just the name of the site :rolleyes:

Silvanus Oct 8th, 2005 8:03 AM

Yeah, PS2 hacking is legal. Warranty-violating, perhaps, but legal.

As to your question: I'm assuming that if you want it to download when you click the download button, you've got to use the TextBox in your function call instead of "http://www.domain.com/filename.txt". Other than that, I don't kow- I'm not really a VB person.

Rory Oct 8th, 2005 8:29 AM

The URLDownloadToFile is actually an Internet Explorer API that most of the time doesn't seem to work anyway, and varies between versions. I would suggest using the winsock control / api, establishing a TCP connection on port 80, and sending a GET request, which would be a lot more reliable, and doesn't rely on IE. There's probably code out there that'll do that already, but its not complicated to do yourself. :)


All times are GMT -5. The time now is 4:00 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC