protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { string Url = "http://www.uol.com.br"; // digite o endereço IsGd isgd = new IsGd(Url); ShortUrlClient client = new ShortUrlClient(isgd); ShortUrlReceive response = client.Receive(); client.Dispose(); HLink.NavigateUrl = response.ShortUrl.AbsoluteUri; } }
public async Task <ActionResult> Index() { string url = "http://www.globo.com"; ShortUrlClient client = new ShortUrlClient(new IsGd(url)); ShortUrlReceive response = await client.ReceiveAsync(); client.Dispose(); ViewBag.Url = response.ShortUrl; return(View()); }
public async Task <ActionResult> Index() { TinyUrl turl = new TinyUrl("http://www.gmail.com"); ShortUrlClient client = ShortUrlClientFactory.Create(turl); ShortUrlReceive response = await client.ReceiveAsync(); client.Dispose(); ViewBag.Url = response.ShortUrl; return(View()); }