小编OhS*_*nap的帖子

将String转换为latlng谷歌地图

我想将一个带有"(53.324523,43.252352)"模式的String转换为latlng.我已经找到了正确的功能:

var input = latlngArray[i];
var latlngStr = input.split(",",2);
var lat = parseFloat(latlngStr[0]);
var lng = parseFloat(latlngStr[1]);
latlngArray[i] = new google.maps.LatLng(lat, lng);
Run Code Online (Sandbox Code Playgroud)

问题是我无法得到合适的纬度.当我使用alert显示它时它只显示NaN,而lng变量显示正确的值.

得到它了.谢谢你的帮助.

var input = latlngArray[i].substring(1, latlngArray[i].length-1);
var latlngStr = input.split(",",2);
var lat = parseFloat(latlngStr[0]);
var lng = parseFloat(latlngStr[1]);
latlngArray[i] = new google.maps.LatLng(lat, lng);
Run Code Online (Sandbox Code Playgroud)

google-maps-api-3

10
推荐指数
1
解决办法
2万
查看次数

安全令牌无法通过身份验证或授权(.net,soap1.2)

过去两周我一直试图访问第三方网络服务,现在我无可奈何地感到困惑.

因此,Web服务是在Intranet中设置的.我有URL,用户和密码来访问它.他们还向我发送了用于生成代理类的.wsdl,但每当我尝试调用函数/方法时,我都会收到错误"安全令牌无法通过身份验证或授权.".

当然,我对webservices等不太满意,但我很确定大多数设置是由代理类完成的.我在那里设置了webservice的URL,并通过凭证和自定义绑定解析了帐户信息,但是出了点问题......第三方开发人员只告诉我,验证模式是NTML Kerberos,它并没有完全帮助我在这里.我尝试将安全性中的authenticationMode设置为Kerberos,但最终只有另一个错误(未找到主体).

代理呼叫:

 var binding = new CustomBinding("CrmDienstWSBinding"); //in web.config
 var proxy = new CrmDienstWSClient(binding, new EndpointAddress("xxxx"));
 proxy.ClientCredentials.UserName.UserName = user;
 proxy.ClientCredentials.UserName.Password = pw;

 var erg = proxy.erstelleAufgabe("false", erstAufg);
Run Code Online (Sandbox Code Playgroud)

代理构造函数:

    public CrmDienstWSClient() {
    }

    public CrmDienstWSClient(string endpointConfigurationName) : 
            base(endpointConfigurationName) {
    }

    public CrmDienstWSClient(string endpointConfigurationName, string remoteAddress) : 
            base(endpointConfigurationName, remoteAddress) {
    }

    public CrmDienstWSClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(endpointConfigurationName, remoteAddress) {
    }

    public CrmDienstWSClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : 
            base(binding, remoteAddress) {
    }
Run Code Online (Sandbox Code Playgroud)

web.config中:

<system.serviceModel>
    <bindings>
      <customBinding>
        <binding name="CrmDienstWSBinding">
          <textMessageEncoding messageVersion="Soap12" …
Run Code Online (Sandbox Code Playgroud)

.net proxy soap

5
推荐指数
1
解决办法
2万
查看次数

选择具有特定属性值的属性

我正在寻找一种在单个LINQ语句中选择具有特定自定义属性和特定值的属性的方法。

我得到了具有所需属性的属性,但是不知道如何选择其特定值。

<AttributeUsage(AttributeTargets.Property)>
Public Class PropertyIsMailHeaderParamAttribute
    Inherits System.Attribute

    Public Property HeaderAttribute As String = Nothing
    Public Property Type As ParamType = Nothing

    Public Sub New()

    End Sub

    Public Sub New(ByVal headerAttribute As String, ByVal type As ParamType)
        Me.HeaderAttribute = headerAttribute
        Me.Type = type
    End Sub

    Public Enum ParamType
        base = 1
        open
        closed
    End Enum
    End Class


    private MsgData setBaseProperties(MimeMessage mailItem, string fileName)
    {
        var msgData = new MsgData();
        Type type = msgData.GetType();
        var props = from p in this.GetType().GetProperties() …
Run Code Online (Sandbox Code Playgroud)

c# linq reflection

1
推荐指数
1
解决办法
1594
查看次数

标签 统计

.net ×1

c# ×1

google-maps-api-3 ×1

linq ×1

proxy ×1

reflection ×1

soap ×1