Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using BitlyAPI;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Diagnostics;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace ShortenLinkBitly
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private async void btnCreate_Click(object sender, EventArgs e)
- {
- var bitly = new Bitly("19ae7ac3e2912e4b688eafd1848e308cb20f082c"); // your accss token
- var linkResponse = await bitly.PostShorten(txt_long_link.Text.Trim());
- var newLink = linkResponse.Link;
- lbl_short_link.Text = newLink;
- }
- private void btn_copy_Click(object sender, EventArgs e)
- {
- Clipboard.SetText(lbl_short_link.Text);
- }
- private void lbl_short_link_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
- {
- Process.Start(lbl_short_link.Text);
- }
- }
- }
Add Comment
Please, Sign In to add comment