【问题标题】:KML not opening in Google Earth through VB.netKML 未通过 VB.net 在 Google 地球中打开
【发布时间】:2014-04-13 18:32:40
【问题描述】:

我正在编写一个应用程序,用于使用我 PC 上安装的 Google 地球打开 KML 文件。但是我的代码没有找到该文件。

这是我的代码:

Public Class openkml
    Sub kmlopener()
        Dim ge As String
        Dim gf As String
        ge = "C:\Program Files (x86)\Google\Google Earth\client\googleearth.exe"
        gf = "C:\Program Files (x86)\Google\Google Earth\client\abc.kml"


        Process.Start(ge, gf)
    End Sub

End Class

另外,只需在命令行 (DOS) 中输入此内容即可打开文件:

"C:\Program Files (x86)\Google\Google Earth\client\googleearth.exe" abc.kml

文件存在于上述位置。 Google 地球打开,但未找到该文件。我也将 kml 文件放在不同的目录中,例如 D 目录,但显示相同的错误。以下是错误截图。

【问题讨论】:

    标签: vb.net kml google-earth


    【解决方案1】:

    问题是路径中的空格。您可以在参数中添加引号,它应该可以工作:

    gf = """C:\Program Files (x86)\Google\Google Earth\client\abc.kml"""
    

    【讨论】:

    • 谢谢。这是我的实际问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-05-20
    相关资源
    最近更新 更多