Download string

Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
1 post Page 1 of 1
Contributors
User avatar
Tilen
VIP - Site Partner
VIP - Site Partner
Posts: 100
Joined: Wed Aug 18, 2010 10:27 am

Download string
Tilen
What?
This program will download a file (.txt or .php) from a FTP Server and put its content to use!

Why?
So you can check for updates, find peoples IP, get strings... Really anything that can be written down...

How?
Over the internet... You just need an FTP Server...
Just Google "Free FTP hosting" as outside links aren't allowed.

I want to make it check for updates!!!
You will need upload a .txt file to your FTP Server with the latest version written inside.
Example:
Code: Select all
v1.0
I want only certain people to use my program!!!
A way you can do this is to get the IP's of the people that you want to use your program.
Create a .php file with the following code and host it on your server.
Code: Select all
<?php echo $_SERVER['REMOTE_ADDR']; ?>
What do I do with Visual Basic???
Add 1 WebClient to your form.

Add this code to your project load page and it will check for updates. Alternatively you can add it to a button.
Code: Select all
        If Not System.Text.Encoding.ASCII.GetString((WebClient1.DownloadData("http://yourfileurl.com/version.txt"))) = "v1.0" Then
            MsgBox("An update is availible")
        End If
Add this code to your project load page and it will only let people with certain IP's use the program.
Code: Select all
        Dim UserIP As String = System.Text.Encoding.ASCII.GetString((WebClient1.DownloadData("http://yourfileurl.com/ip.php")))
        If UserIP = "IP1" Then
        ElseIf UserIP = "IP2" Then
        ElseIf UserIP = "IP3" Then
        ElseIf UserIP = "IP4" Then
        Else
            MsgBox("Your IP is not authorized to use this program" & vbNewLine & "The program will now close.", MsgBoxStyle.Exclamation, "Not Authorized!")
            End
        End If
If you need any help, just post below ;)
If you would like to see some other features, PM me.
1 post Page 1 of 1
Return to “Tutorials”