Pandy_PB 2021-06-07 14:19 采纳率: 20%
浏览 48
已结题

Google 在线翻译求助(vb.net)

 

 Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Dim strTextToConvert As String
        Dim objInternetExplorer As SHDocVw.InternetExplorer
        Dim strInputLangId As String
        Dim strOutputLangId As String
        'Open the excel 

        strTextToConvert = TextBox1.Text

        If strTextToConvert = "" Then Exit Sub

        ' Tools Reference Select Microsoft internet Control
        objInternetExplorer = CreateObject("InternetExplorer.Application")

        'INPUT LANGUAGE
        strInputLangId = "auto"

        'output language
        strOutputLangId = "en"

        'open website
        objInternetExplorer.Visible = True
        objInternetExplorer.Navigate("http://translate.google.cn/#" & strInputLangId & "/" & strOutputLangId & "/" & strTextToConvert & "")

'' 目前状态:
''可以打开google翻译网页,并翻译出已输入在textbox1中的内容。

''要求:
''1:将翻译后的 英文 结果返回至textbox2中,请提供VB.NET或者C#代码
''2:下面msgbox中的内容是js中的,但在C#或者VB.NET中无法使用,请参考
''MsgBox(objInternetExplorer.Document.getElementById("result_box").innerHTML)



    End Sub
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 关于web前端如何播放二次加密m3u8视频的问题
    • ¥20 spring boot集成mqtt的使用问题
    • ¥15 使用百度地图api 位置函数报错?
    • ¥15 metamask如何添加TRON自定义网络
    • ¥66 关于川崎机器人调速问题
    • ¥15 winFrom界面无法打开
    • ¥30 crossover21 ARM64版本安装软件问题
    • ¥15 mymetaobjecthandler没有进入
    • ¥15 mmo能不能做客户端怪物
    • ¥15 osm下载到arcgis出错