小编Ale*_*lex的帖子

在设置WCF客户端和服务器时,配置文件必须同步如何?

大多数WCF示例都向您展示了如何配置WCF客户端和服务器.现在,如果您在它们之间稍微改变配置会发生什么?我的意思是,谁有最终决定权?

我们以此客户端配置为例:

<configuration>
<system.serviceModel>
    <bindings>
        <wsHttpBinding>
            <binding name="WSHttpBinding_ISampleService" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00"
                bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                allowCookies="false">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                    maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <reliableSession ordered="true" inactivityTimeout="00:10:00"
                    enabled="false" />
                <security mode="Message">
                    <transport clientCredentialType="None" proxyCredentialType="None"
                        realm="" />
                    <message clientCredentialType="Windows" negotiateServiceCredential="true"
                        algorithmSuite="Default" establishSecurityContext="true" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://localhost:8080/SampleService" binding="wsHttpBinding"
            bindingConfiguration="WSHttpBinding_ISampleService" contract="ISampleService"
            name="WSHttpBinding_ISampleService">
        </endpoint>
    </client>
</system.serviceModel>
Run Code Online (Sandbox Code Playgroud)

通常,服务器端将在其公开的服务器上配置完全相同的绑定.

但是,如果在服务器端使用openTimeout = 00:00:30定义,现在会发生什么.什么是超时?谁赢?我为所有其他参数做同样的问题.

对于配置的每个元素(绑定,客户端,服务,行为等)及其所有细节,需要哪些参数以及在哪一方(客户端或服务器),整个事情看起来都是一团糟,你怎么知道呢?

看起来您可以在服务器端定义整个绑定以及所有超时参数,并且在客户端简单地放置所需的最小配置,以便接受来自服务器的所有参数.但是现在,考虑到服务器具有更深入的配置,客户端上所需的最低参数是多少?

使用WCF配置客户端和服务器时,关于配置的每个元素的参数有哪些最佳实践:绑定,服务,客户端/端点和行为?

在客户端和服务器之间定义冲突参数时,WCF如何处理它?

.net wcf configuration-files

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

如何使用Win32 / User32库检查当前的鼠标按钮状态?

我知道如何使用User32 SendInput方法来激发点击,而我需要的是类似的User32方法,但是要获得当前的鼠标按钮状态。

类似于:

public static extern bool GetCursorPos(ref System.Drawing.Point lpPoint);

函数GetCursorPos给我当前的光标位置。我需要的是左按钮状态(是否单击)。有这样的功能吗?

c# c++ mouse winapi

3
推荐指数
2
解决办法
7954
查看次数

标签 统计

.net ×1

c# ×1

c++ ×1

configuration-files ×1

mouse ×1

wcf ×1

winapi ×1