English 中文(简体)
谷歌APIC如何强制执行 desktop的使用限制?
原标题:How does Google s API enforce usage limits for a desktop app?

I m using Google s DistanceMatrix API from a VB.net desktop app using HttpWebRequest. I pass it a URL containing two locations (Expressed as Longitude and Latitude) and it gives me driving distances in miles and minutes using real streets. (Actually meters and seconds but I convert it.)

It works great from my desktop. The most significant part of my code is below. But I m not a web / internet / networking guy, and I m doing this by example. So far I don t have to know how it works and I m cool with that.

THE PROBLEM: Google says they have usage limits. Personally I don t approach those limits but my app may be distributed to many, and if a lot of others use it, together we will. In fact some users might go over the limits from a single workstation. I am willing to pay for extra usage if needed, but I don t know if I would be required to do so in this situation.

THE QUESTION: I ve looked thoroughly, (or at least I think I have) and as far as I can see Google doesn t document exactly how they monitor usage in this scenario. The documentation seems to assume it will always be used from a web server, and there are some references in the documentation that it can t be used from certain domains. But this is a windows forms app, so is it really "by domain"? What domain? Is it the service provider s domain? Or is it by IP Address? And importantly, will each user be counted separately in this situation or will it be somehow tied to the app itself wherever it may reside?

如果我看上去.子,就医。 但是,在这方面是否有任何帮助?

我的法典的相关职能如下,也在此为本文提供谷歌文件页。

http://code.google.com/apis/maps/documentation/distancematrix/

Public Function GetHTML(ByVal URL As String, Optional ByVal UserName As String = "", Optional ByVal Password As String = "") As String
    Try
        Dim reader As StreamReader
        Dim Request As HttpWebRequest = HttpWebRequest.Create(URL)
         The following line empowers some downloads to work.
        If UserName <> "" Then
            Request.Credentials = New NetworkCredential(UserName, Password)
        End If
        Request.AllowAutoRedirect = True
        Request.CookieContainer = CookieJar
        Dim Response As HttpWebResponse = Request.GetResponse()
        reader = New StreamReader(Response.GetResponseStream())
        Response.Close()
        Return reader.ReadToEnd()
    Catch
        Return ""
    End Try
End Function
最佳回答

The usage limits described in the documentation would have no identifying information from your application (just look at the http call you are issuing to Google), so the limits would be enforced on a per-user basis. Perhaps if you contact Google s sales team they can provide more information about how to address your use case with the potential for users to need higher limits.

问题回答

暂无回答




相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签