help getting to appdata

cpgames

Member
Joined
Sep 14, 2011
Messages
14
Programming Experience
Beginner
i am download a file that needs to save in app data and i get an error when i use this code

VB.NET:
My.Computer.Network.DownloadFile _
    ("http://www.cpgames.co.uk/minecraft.jar", _
    "c:\Documents and settings",System.Environment.UserName"\appdata\roaming\.minecraft\minecraft.jar")

        MsgBox("done")

i would be happy if someone was to correct my error or tell me what i have done rong


thanks charlie
 
The path you provide needs to be a single String. If you have multiple Strings that you want to combine into a single String, that's not how you do it. I'm sure that you have joined two Strings together before. If you haven't then you should not be worrying about downloading files until you have covered the basics.

Also, you should be using Environment.GetFolderPath or My.Computer.FileSystem.SpecialDirectories to get standard folder paths like Application Data.
 
Back
Top