Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I'm using vb.net . and I have downloaded this code for google translation to use it in my Project. but this messege appeared, It's an error:

Interface 'System.Collections.Generic.ICollection(Of Google.API.Language)' cannot be indexed because it has no default property.


and this is my code :

VB
Public Class Form4
    Dim S1 As String = "JJJJJJ"
    Dim Counter1 As Integer = 0

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            For i As Integer = 0 To Google.API.Translate.LanguageUtility.LanguageCollection.Count - 1

                Me.ListBox1.Items.Add(Google.API.Translate.LanguageUtility.LanguageCollection(i))
                Me.ListBox2.Items.Add(Google.API.Translate.LanguageUtility.LanguageCollection(i))
            Next
            Me.ListBox1.Items.RemoveAt(0)
            Me.ListBox2.Items.RemoveAt(0)

            Me.Label6.Text = "You Have  " & Me.ListBox1.Items.Count & "  Language"
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

    End Sub
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try
            Me.RichTextBox1.Text = Google.API.Translate.Translator.Translate(Me.RichTextBox2.Text, Me.ListBox1.SelectedIndex + 1, Me.ListBox2.SelectedIndex + 1)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Try
            Dim X1 As Int16
            Dim X2 As Int16

            X1 = Me.ListBox1.SelectedIndex
            X2 = Me.ListBox2.SelectedIndex

            Me.ListBox1.SelectedIndex = X2
            Me.ListBox2.SelectedIndex = X1

        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub
    Private Sub T1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles T1.Tick
        Try
            If Counter1 = S1.Length - 1 Then
                Me.Label5.Text = ""
                Counter1 = 0
            End If
            Label5.Text += S1.Chars(Counter1)
            Counter1 += 1
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Private Sub Label6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label6.Click

    End Sub
End Class



please help me ...
Posted
Updated 10-Mar-10 17:50pm
v2

1 solution

Try the new release of Google API
http://code.google.com/p/google-api-for-dotnet/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900