日期:2014-05-18  浏览次数:21168 次

紧急求教:这句VB代码用C#应该如何写:
VB:
private Shared GeocodeAddress As New EndPointAddress(BingMap.GeocodeUrl)
我写成:
private static GeocodeAddress = new EndpointAddress(BingMap.GeocodeUrl);多处报错;
OR 
private static string GeocodeAddress = new EndpointAddress(BingMap.GeocodeUrl);
也报错。

在线等答案,请指导。


------解决方案--------------------
字面上翻译应该是
private static EndpointAddress GeocodeAddress = new EndpointAddress
(BingMap.GeocodeUrl);
------解决方案--------------------
private static EndPointAddress GeocodeAddress = new EndPointAddress(BingMap.GeocodeUrl);
------解决方案--------------------
private static GeocodeAddress = new EndpointAddress(BingMap.GeocodeUrl);

你的看EndpointAddress返回的类型是什么?
------解决方案--------------------
在线转码的结果是:
C# code

private static EndPointAddress GeocodeAddress = new EndPointAddress(BingMap.GeocodeUrl);