小编Khu*_*ziz的帖子

频道'tcp'已经注册

我希望给定的应用程序(Windows服务)充当远程服务器以及远程客户端.在生产中,我将运行我的应用程序的两个实例,通过.NET Remoting相互监视,并相应地报告失败.

我已经编写了一个基本的部分,并且"已经注册了"通道'tcp'"例外..我想以编程方式设置通道配置.

c# remoting

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

特定Sharepoint列表的自定义操作菜单

我希望自定义操作菜单应用于特定列表; 目前使用以下XML指定它,它将应用于所有列表!

更具体地说; 我甚至希望将此自定义操作应用于特定列表的特定视图...

<CustomAction
    Id="MyCustomActionId"
    Title="My Custom Action"
    Description="My Custom Action Description"
    RequireSiteAdministrator="FALSE"
    RegistrationType="List"
    GroupId="ActionsMenu"
    Sequence="1000"
    Location="Microsoft.SharePoint.StandardMenu" >
    <UrlAction Url="{SiteUrl}/_layouts/MySharepointArtifacts/MyCustomAction.aspx?ListId={ListId}"/>
  </CustomAction>
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

sharepoint sharepoint-2007

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

使用命名互斥

我有两个运行相同 Windows 服务的实例。他们检查彼此的健康状况并报告是否发现任何问题。我有一项需要执行的关键工作,所以我使用故障转移方法运行它,它在主服务器中运行,如果主服务器没有响应,它会在从服务器中运行。这项工作需要通过特定的串行端口进行通信,我正在尝试使用互斥锁来检查竞争条件。我无权访问生产,所以在部署之前我想确保我的方法没问题。所以请建议我对 Mutex 的使用是否适用于给定的情况。

if (iAmRunningInSlave)
{
   HealthClient hc = new HealthClient();
   if (!hc.CheckHealthOfMaster())
      return this.runJobWrapper(withMutex, iAmRunningInSlave);
   else
      return true; //master is ok, we dont need to run the job in slave
}
return this.runJobWrapper(withMutex, iAmRunningInSlave);
Run Code Online (Sandbox Code Playgroud)

然后在 runJobWrapper

bool runJobWrapper(bool withMutex, bool iAmRunningInSlave)
{
   if (!withMutex)
      return this.runJob(iAmRunningInSlave); //the job might be interested to know 
   Mutex mutex = null;
   string mutexName = this.jobCategory + "-" + this.jobTitle; //this will be unique for given job
   try
   {
      mutex = Mutex.OpenExisting(mutexName); …
Run Code Online (Sandbox Code Playgroud)

c# mutex

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

将DateTime转换为nvarchar,只是月份和年份

如何将datetime值转换为nvarchar,并希望将其格式化为"Month,Year",例如2009年10月1日的值应转换为"2009年10月"

t-sql sql-server sql-server-2005

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