So I've got a code in VB that will download a txt file from a website. The problem is I want this file to be downloaded into whatever folder that my program is in.

for example, if my program was in C:\random_folder\ then I would want this txt file downloaded to C:\random_folder\

Here is some of my code:
Code:

My.Computer.Network.DownloadFile _
    ("http://www.mywebsite.com/test.txt", _
    "define where file should go here")

But in the spot to put where to place the file, I can't just put C:\random_folder\ because individual users may have this program installed in other parts of there computer.

Thanks alot in advance.

Recommended Answers

All 2 Replies

Looks like .NET code but in VB6 we would use App.Path...

Good Luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.