vb.net - Download to root directory -
okay, have been searching ages find no luck.
i using:
me.downloader.downloadfileasync(new uri(fileurl), path.getfilename(fileurl), stopwatch.startnew)
to download file want save root directory of program in file called launcher.
so example, if program on desktop , open , click start want create launcher folder if it's missing download files , if it's not download files it.
i've been looking everywhere find code allow me , have tried lots of different things.
at moment, justs saves in root directory of program is.
thanks.
try this:
dim basedir string = appdomain.currentdomain.basedirectory dim launcherdir string = path.combine(basedir, "launcher") if not directory.exists(launcherdir) directory.createdirectory(launcherdir) end if dim targetfile = path.combine(launcherdir, path.getfilename(fileurl)) me.downloader.downloadfileasync(new uri(fileurl), targetfile, stopwatch.startnew)
Comments
Post a Comment