3

不想离开client.ncconf我的exe,我希望能够以client.ncconf编程方式指定文件的路径。我怎么可能?我正在使用 NCache 4.4SP1 开源。

我使用的方法主要是Web.Caching.NCache.InitializeCacheCache.Get

4

1 回答 1

1

它从. 只需在您的 AppSettings 中添加以下内容%NCHOME% InstallDir/config

<add key="InstallDir" value="C:\temp"/>

此外,所有客户端配置都可以使用CacheInitParams. 你可以

namespace Alachisoft.NCache.Web.Caching
{
    public class CacheInitParams : ICloneable
    {
        public CacheInitParams();

        public string BindIP { get; set; }
        public ClientCacheSyncMode ClientCacheSyncMode { get; set; }
        public int ClientRequestTimeOut { get; set; }
        public int CommandRetries { get; set; }
        public int CommandRetryInterval { get; set; }
        public int ConnectionRetries { get; set; }
        public int ConnectionTimeout { get; set; }
        public string DefaultReadThruProvider { get; set; }
        public string DefaultWriteThruProvider { get; set; }
        public bool LoadBalance { get; set; }
        public CacheMode Mode { get; set; }
        [Obsolete("This property is deprecated. Please use the 'ServerList' property instead.", false)]
        public int Port { get; set; }
        public SecurityParams PrimaryUserCredentials { get; set; }
        public int RetryConnectionDelay { get; set; }
        public int RetryInterval { get; set; }
        public SecurityParams SecondaryUserCredentials { get; set; }
        [Obsolete("This property is deprecated. Please use the 'ServerList' property instead.", false)]
        public string Server { get; set; }
        public CacheServerInfo[] ServerList { get; set; }

        public object Clone();
    }
}
于 2016-02-24T11:06:47.577 回答