[C#] TinyURL Generator

Vick

Member
Reputation
0
[C#] TinyURL Generator

Requirements
1. 2 textboxes
2. 1 button

What it does
1. User enters a URL
2. Click Button
3. Returns TinyURL

Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;

namespace teeee
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            System.Net.WebClient a = new System.Net.WebClient();
            string b = a.DownloadString("http://tinyurl.com/api-create.php?url=" + textBox1.Text);
            textBox2.Text = b.ToString();
        }
    }
}
 
Wow! thank you for that threat! I think I'm gonna do something with this!
thank you!
 
Huh, that looks pretty awesome, never seen a webclient in a source. Gonna try this sometime.
 
Code:
        Dim a As New System.Net.WebClient
        Dim b As String = a.DownloadString("http://tinyurl.com/api-create.php?url=" & TextBox1.Text)
        TextBox2.Text = b.ToString
That's the button code in VB.NET, for anyone needing it.
 


Good job man, I'm so proud that users are taking my source and converting to other languages. So others can learn. Good job!!
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…