Today, I'm going to teach you how to make a URL Shortener.
You'll need:
Visual Basic 2008/2010 (I'm using 2008)
2 Labels
2 Textbox
1 Button
Editing The Texts (NOT THE NAMES):
Edit Label1 to "URL To Shorten"
Edit Label2 to "Shortened URL"
Edit Button to "Shorten!"
Should look something like this:
Now For Coding:
At this at the very top!
[vb]Imports System.Net ' This imports System.Net[/vb]
Add this into Button1
[vb]Dim wc As New WebClient ' Substitutes WebClient as wc
Dim strings As String ' Makes strings as a string
strings = wc.DownloadString("http://tinyurl.com/api-create.php?url=" & TextBox1.Text) ' It copies the texts in the site which saves in strings
wc.Dispose() ' Disposes the WebClient
TextBox2.Text = strings ' Pastes the text in strings onto TextBox2[/vb]
And your done!
You'll need:
Visual Basic 2008/2010 (I'm using 2008)
2 Labels
2 Textbox
1 Button
Editing The Texts (NOT THE NAMES):
Edit Label1 to "URL To Shorten"
Edit Label2 to "Shortened URL"
Edit Button to "Shorten!"
Should look something like this:
Now For Coding:
At this at the very top!
[vb]Imports System.Net ' This imports System.Net[/vb]
Add this into Button1
[vb]Dim wc As New WebClient ' Substitutes WebClient as wc
Dim strings As String ' Makes strings as a string
strings = wc.DownloadString("http://tinyurl.com/api-create.php?url=" & TextBox1.Text) ' It copies the texts in the site which saves in strings
wc.Dispose() ' Disposes the WebClient
TextBox2.Text = strings ' Pastes the text in strings onto TextBox2[/vb]
And your done!