一个客户端,到服务器端取数据,两台电脑需要用户,密码登陆才能访问。
remoting怎么处理这个?是不是能直接访问服务器,不需要登陆验证?

解决方案 »

  1.   

    ref:http://www.microsoft.com/china/msdn/library/architecture/architecture/architecturetopic/BuildSucApp/BSAAsecmod11.mspx?mfr=trueIDictionary channelProperties =  
                             ChannelServices.GetChannelSinkProperties(proxy);
    NetworkCredential credentials;
    credentials = new NetworkCredential("username", "password", "domain");
    ObjRef objectReference = RemotingServices.Marshal(proxy);
    Uri objectUri = new Uri(objectReference.URI);
    CredentialCache credCache = new CredentialCache();
    // Substitute "authenticationType" with "Negotiate", "Basic", "Digest", 
    // "Kerberos" or "NTLM"
    credCache.Add(objectUri, "authenticationType", credentials);
    channelProperties["credentials"] = credCache;
    channelProperties["preauthenticate"] = true;
      

  2.   

    要看remoting服务端承载在哪儿, iis,windows service,还是其他