I found the following code to create a tinyurl.com url:
http://tinyurl.com/api-create.php?url=http://myurl.com
This will automatically crea
Here my version of the implementation:
static void Main()
{
var tinyUrl = MakeTinyUrl("https://stackoverflow.com/questions/366115/using-tinyurl-com-in-a-net-application-possible");
Console.WriteLine(tinyUrl);
Console.ReadLine();
}
public static string MakeTinyUrl(string url)
{
string tinyUrl = url;
string api = " the api's url goes here ";
try
{
var request = WebRequest.Create(api + url);
var res = request.GetResponse();
using (var reader = new StreamReader(res.GetResponseStream()))
{
tinyUrl = reader.ReadToEnd();
}
}
catch (Exception exp)
{
Console.WriteLine(exp);
}
return tinyUrl;
}