如何使用VB.net 2010访问bit.ly
API - 是否可能?怎么样?
答案 0 :(得分:4)
我很感兴趣,看看它是如何工作的,这可能会让你开始:
Option Infer On
Imports System.Net
Imports System.Web
Module Module1
Sub Main()
Dim wc = New WebClient()
Dim login = "your_login"
Dim apiKey = "your_apikey"
Dim longUrl = HttpUtility.UrlEncode("http://stackoverflow.com/questions/4427104/vb-is-there-any-possibility-to-call-the-bit-ly-api")
Dim request = String.Format("http://api.bit.ly/v3/shorten?login={0}&apiKey={1}&longUrl={2}&format=txt", login, apiKey, longUrl)
Dim result = wc.DownloadString(request)
End Sub
End Module
可以在此处找到API文档:http://code.google.com/p/bitly-api/wiki/ApiDocumentation
答案 1 :(得分:1)