Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: Killer360 on October 02, 2006, 06:02 PM

Title: File Transfer with VB Express 2005
Post by: Killer360 on October 02, 2006, 06:02 PM
Hi, I just had a few quick questions. I'm a complete NOOB at programming, I have NO idea. I've heard about this board several times and I thought it would be a good place to start.

I had an idea today to make a Hash Downloader program. I've got this far:
(http://xs107.xs.to/xs107/06402/vb.jpg)


I know, it's not far at all.

I would like to make an installer that will install the program and also make a directory on the persons computer: C:\HASHES . Then when the person clicks on the button, it will download the file from my server to that directory automatically. But how do I use File Transfer? :)

If you can give any help, that wold be great. I think my friend can probably help me out with the installer.

Title: Re: File Transfer with VB Express 2005
Post by: topaz on October 02, 2006, 06:09 PM
HTTP file transfer?
Title: Re: File Transfer with VB Express 2005
Post by: Killer360 on October 02, 2006, 06:09 PM
Yes.
Title: Re: File Transfer with VB Express 2005
Post by: K on October 02, 2006, 06:55 PM
You can use the System.Net.WebClient (http://msdn2.microsoft.com/en-us/library/system.net.webclient.aspx) class.
Title: Re: File Transfer with VB Express 2005
Post by: Killer360 on October 02, 2006, 07:14 PM
Ok, How do I add that line? Which tab do I click on? Also, can I add a status bar line so it will show how much the file has downloaded?

This is where I'm at:
(http://img87.imageshack.us/img87/7444/vb1my6.th.jpg) (http://img87.imageshack.us/my.php?image=vb1my6.jpg)
Title: Re: File Transfer with VB Express 2005
Post by: Spilled on October 02, 2006, 07:30 PM
Not very far eh? lol.
Title: Re: File Transfer with VB Express 2005
Post by: Killer360 on October 02, 2006, 08:37 PM
Quote from: Spilled on October 02, 2006, 07:30 PM
Not very far eh? lol.
Not at all. :)

First day.  :-\ :'(
Title: Re: File Transfer with VB Express 2005
Post by: FrostWraith on October 02, 2006, 08:43 PM
Check this out as well.
http://www.codeguru.com/vb/gen/vb_graphics/fileformats/article.php/c6743
Title: Re: File Transfer with VB Express 2005
Post by: Mystical on October 02, 2006, 08:43 PM
Suggestion, Don't come asking for help on somthing more advanced when you don't even know how to use the Button CLICK method im sure.

Atleast take a few months, learn the programming language your using, do some searching on www.pscode.com & www.google.com


P.S.

 ATLEAST DO A HELLO WORLD EXPAMPLE. =|
Title: Re: File Transfer with VB Express 2005
Post by: l2k-Shadow on October 02, 2006, 09:38 PM
Quote from: Killer360 on October 02, 2006, 07:14 PM
Ok, How do I add that line? Which tab do I click on? Also, can I add a status bar line so it will show how much the file has downloaded?

This is where I'm at:
(http://img87.imageshack.us/img87/7444/vb1my6.th.jpg) (http://img87.imageshack.us/my.php?image=vb1my6.jpg)

lmao
>>
http://www.dummies.com/WileyCDA/DummiesTitle/productCd-076457728X.html

Here is the thing.. when beginning to program don't try to make a program that may be even remotely difficult to make, you won't succeed. Do a "Hello world", proceed to a calculator, and some other simplistic programs to get a little hang of the language before you even attempt making something that requires the internet. For some reason a lot of people think along these lines "omg where can i dl VB? I wanna make a bot!". Well even though it's Visual Basic it is still a programming language and has to be learned to be programmed in. So to sum it up it's awesome that you wish to learn how to program but read a tutorial and start with something more simple first.
Title: Re: File Transfer with VB Express 2005
Post by: Joe[x86] on October 02, 2006, 10:20 PM
I still can't program a calculator in VB without much effort, other than simple four-function that can work with only two values. After that it gets quite hard to find the next operation, position wise.
Title: Re: File Transfer with VB Express 2005
Post by: RealityRipple on October 02, 2006, 10:40 PM
Uhm... VBScript.Eval strEquation FTW.
Title: Re: File Transfer with VB Express 2005
Post by: Mystical on October 02, 2006, 10:52 PM
weird, I bet i couldn't even do a calculator lol..
Title: Re: File Transfer with VB Express 2005
Post by: Joe[x86] on October 03, 2006, 07:03 AM
Quote from: RealityRipple on October 02, 2006, 10:40 PM
Uhm... VBScript.Eval strEquation FTW.

Bad coding habits, to rely on a control to do your programs core function (remember, that's like CSB!), especially when the library isn't designed for it anyhow. :)
Title: Re: File Transfer with VB Express 2005
Post by: Killer360 on October 03, 2006, 07:32 AM
Hmm, I'll look at some tutorials on the microsoft website for more information.. Thanks. :)
Title: Re: File Transfer with VB Express 2005
Post by: K on October 03, 2006, 03:02 PM
Quote from: Joex86] link=topic=15816.msg159344#msg159344 date=1159845640]
I still can't program a calculator in VB without much effort, other than simple four-function that can work with only two values. After that it gets quite hard to find the next operation, position wise.

Convert the equation from infix to postfix.
Go through each token from left to right.
If the token is a number, push it onto a stack.
If the token is an binary operator, pull two values from the stack and evaluate.  push the result back onto the stack.
Continue until you have run through each token.  If the equation was valid, there will be only one result left on the stack.

This approach is simpler than constructing a parse tree, but it has some limitations.  It is difficult to account for unary operators such as a negative sign or a factorial operator when converting from infix to postfix.
Title: Re: File Transfer with VB Express 2005
Post by: Zer0 on October 03, 2006, 11:47 PM
here is the easiest way to do it..... or so i think


        hashStatus.Text = "Downloading..."
        Dim wc As New System.Net.WebClient()
        wc.DownloadFile("http://www.allieszer0.com/hash/star/starcraft.exe", _
                 App_Path() + "/star/starcraft.exe")
        wc.DownloadFile("http://www.allieszer0.com/hash/star/battle.snp", _
                 App_Path() + "/star/battle.snp")
        wc.DownloadFile("http://www.allieszer0.com/hash/star/storm.dll", _
                 App_Path() + "/star/storm.dll")
        hashStatus.Text = "Done SC..."