为 SQL 数据库动态生成短 URL? [英] Dynamically generate short URLs for a SQL database?

查看:33
本文介绍了为 SQL 数据库动态生成短 URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户拥有超过 400,000 名客户的数据库.每个客户都分配了一个 GUID.他希望我选择所有记录,创建一个包含此 GUID 作为参数的动态短 URL".然后将此短网址保存到每个客户记录的字段中.

My client has database of over 400,000 customers. Each customer is assigned a GUID. He wants me to select all the records, create a dynamic "short URL" which includes this GUID as a parameter. Then save this short url to a field on each clients record.

我的第一个问题是,是否有任何网址缩短网站允许您像这样以编程方式即时创建短网址?

The first question I have is do any of the URL shortening sites allow you to programatically create short urls on the fly like this?

推荐答案

TinyUrl 允许你这样做(没有被广泛记录),例如:

TinyUrl allow you to do it (not widely documented), for example:

http://tinyurl.com/api-create.php?url=http://www.stackoverflow.com/

变成http://tinyurl.com/6fqmtu

所以你可以有

http://tinyurl.com/api-create.php?url=http://mysite.com/user/xxxx-xxxx-xxxx-xxxx

http://tinyurl.com/64dva66.

guid 并没有那么清楚,但 URL 应该是唯一的

The guid doesn't end up being that clear, but the URLs should be unique

请注意,您必须通过 HTTPWebRequest 传递它并获得响应.

Note that you'd have to pass this through an HTTPWebRequest and get the response.

这篇关于为 SQL 数据库动态生成短 URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆