Like a program that stores files and when installed on other computers the files can be downloaded? just put this together to show you what i mean for it to do(will not look like this is the final program);
While you could use that, System.Net.WebClient would be better suited for this as it already has a DownloadFile method. You just need to upload the files to a server or file host that supports hotlinking.
You'll need; Server (FTP access for uploading, and permissions for downloading) App (uploads using FTP credentials, and downloads from file location) Like amd42 said, use WebClient. You'll probably want to run the async file download function.
Code: string FtpServer = "ftp.example.com"; string FtpUsername = "exampleusername"; string FtpPassword = "password"; string FileName = "Lol.exe"; WebClient Client = new WebClient(); NetworkCredential FtpCredential = new NetworkCredential(FtpUsername, FtpPassword); Client.Credentials = FtpCredential; Client.DownloadFile(FtpServer, FileName); //Upload A File Client.UploadFile(FtpServer + "\\" + FileName, "C:\\textfile.txt"); Just like XG R4PiDzZ said, you will need to get an Ftp account.
... he didn't mention anything about using a webserver ... >_> ftp is completely unnecessary for something this simple err actually, now that I re-read the OP, it sounds like your making an AIO-like program, which requires no networking. Is that what you're doing?
Yeah, Mediafire will work fine if you just want to download. Uploading to Mediafire may cause a problem, as I don't believe there is a public API. That's why I recommended using a your own server.
how would i go about making the program with mediafire and you have to pay to get a server which im not wanting to do
Just use 000webhost if this is a temporary program, and just upload it. Then you could just put 3 web browsers in your form hidden then set link to the link of each program, to the button. then click button 1 and put Webbrowser1.Navigate("www.myhostname.com/file") And it should work. Haven't programmed in like 4 years so I'm not sure if that is right;/
no those files where an example..i want to be able to upload files from the program and download them..
You can use any web host you want use the code listed above and just swap out the ftp to your webhost my favorite is weebly because you upload and mange only your files not a hugr networking site like mediafire i will put atut up soon since im making my own assistant for my team/staff! Code: string FtpServer = "ftp.example.com"; string FtpUsername = "exampleusername"; string FtpPassword = "password"; string FileName = "Lol.exe"; WebClient Client = new WebClient(); NetworkCredential FtpCredential = new NetworkCredential(FtpUsername, FtpPassword); Client.Credentials = FtpCredential; Client.DownloadFile(FtpServer, FileName); //Upload A File Client.UploadFile(FtpServer + "\\" + FileName, "C:\\textfile.txt");
Making an FTP client is not the only way of doing this. In fact, I would recommend against it if possible. Doing so would require that you leave the password in your program somewhere. This means that if someone disassembles the program or sniffs the packets it sends out, then he would be able to obtain the login information and have complete access to the FTP server. Who knows what could happen then. A more secure way of making a file host would be to route all uploads and downloads through a PHP script (the x10host.com site that FiireModz linked to supposedly supports PHP). This would prevent people from having complete access to your server (assuming that there are no security issues in your PHP script) and would also be a lot more flexible in the long run - for example, you could track upload and download stats, impose limits on how many files someone can upload, or set up a user account and private storage system. For more information on making PHP scripts to do this, you can check out this tutorial that I found or search around on Google: http://net.tutsplus.com/tutorials/php/online-file-storage-with-php/