当前位置: 首页>>代码示例>>C#>>正文


C# PhysicalServer类代码示例

本文整理汇总了C#中PhysicalServer的典型用法代码示例。如果您正苦于以下问题:C# PhysicalServer类的具体用法?C# PhysicalServer怎么用?C# PhysicalServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PhysicalServer类属于命名空间,在下文中一共展示了PhysicalServer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: RegisterRealTasks

 public override void RegisterRealTasks(PhysicalServer s)
 {
     s.AddTask(new RunSqlScriptTask(s.Name, _databaseName)
               {
                   ScriptToRun = ScriptToRun
               });
 }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:ProtoRunSqlScriptTask.cs

示例2: RegisterRealTasks

 public override void RegisterRealTasks(PhysicalServer server)
 {
     foreach (BaseProtoTask task in _innerTasks)
     {
         task.RegisterRealTasks(server);
     }
 }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:RavenDbConfigurator.cs

示例3: RegisterRealTasks

        public override void RegisterRealTasks(PhysicalServer site)
        {
            string filePath = site.MapPath(_filePath);

            var o = new XmlPokeTask(filePath, _items, new DotNetPath());
            site.AddTask(o);
        }
开发者ID:abusby,项目名称:dropkick,代码行数:7,代码来源:ProtoXmlPokeTask.cs

示例4: RegisterRealTasks

 public override void RegisterRealTasks(PhysicalServer server)
 {
     var to = server.MapPath(_to);
     var archiveFilename = _isLocal ? _archiveFilename : server.MapPath(_archiveFilename);
     var task = new UnzipArchiveTask(archiveFilename, to, _options, _path);
     server.AddTask(task);
 }
开发者ID:Allon-Guralnek,项目名称:dropkick,代码行数:7,代码来源:ProtoUnzipArchiveTask.cs

示例5: RemoteNServiceBusHostTask

        public RemoteNServiceBusHostTask(string exeName, string location, string instanceName, PhysicalServer site, string username, string password, string serviceName, string displayName, string description)
        {
            string args = string.IsNullOrEmpty(instanceName)
                            ? ""
                            : " /instance:\"{0}\"".FormatWith(instanceName);

            if (username != null && password != null)
            {
                var user = username;
                var pass = password;
                if (username.ShouldPrompt())
                    user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName));
                if (shouldPromptForPassword(username, password))
                    pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username));

                args += " /userName:\"{0}\" /password:\"{1}\"".FormatWith(user, pass);
            }

            if (!string.IsNullOrEmpty(serviceName))
                args += " /serviceName:\"{0}\"".FormatWith(serviceName);

            if (!string.IsNullOrEmpty(displayName))
                args += " /displayName:\"{0}\"".FormatWith(displayName);

            if (!string.IsNullOrEmpty(description))
                args += " /description:\"{0}\"".FormatWith(description);

            _task = new RemoteCommandLineTask(exeName)
            {
                Args = "/install" + args,
                ExecutableIsLocatedAt = location,
                Machine = site.Name,
                WorkingDirectory = location
            };
        }
开发者ID:bertvan,项目名称:dropkick,代码行数:35,代码来源:RemoteNServiceBusHostTask.cs

示例6: RegisterRealTasks

 public override void RegisterRealTasks(PhysicalServer site)
 {
     var task = new PublishSsrsTask(_publishTo);
     task.AddReportsIn(_publishAllIn);
     task.AddReport(_publish);
     site.AddTask(task);
 }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:ProtoSsrsTask.cs

示例7: RemoteMsmqGrantReadWriteTask

 public RemoteMsmqGrantReadWriteTask(PhysicalServer server, string queueName, string group)
 {
     _server = server;
     _group = group;
     var ub = new UriBuilder("msmq", server.Name) { Path = queueName };
     _address = new QueueAddress(ub.Uri);
 }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:RemoteMsmqGrantReadWriteTask.cs

示例8: RegisterRealTasks

        public override void RegisterRealTasks(PhysicalServer site)
        {
            var ub = new UriBuilder("msmq", site.Name) { Path = _queue };
            var task = new MsmqGrantWriteTask(site, new QueueAddress(ub.Uri), _group);

            site.AddTask(task);
        }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:ProtoMsmqGrantWriteTask.cs

示例9: RemoteNServiceBusInstallTask

        public RemoteNServiceBusInstallTask(string exeName, string location, string instanceName, PhysicalServer site, string username, string password,
            string serviceName, string displayName, string description, bool startManually)
        {
            StringBuilder args = new StringBuilder("/install ");

            if (username != null && password != null)
            {
                var user = username;
                var pass = password;
                if (username.ShouldPrompt())
                    user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName));
                if (password.ShouldPrompt())
                    pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username));

                args.Append(" /username:{0} /password:{1}".FormatWith(user, pass));
            }

            if (!string.IsNullOrEmpty(instanceName)) args.AppendFormat(" /instanceName:{0}", instanceName);
            if (!string.IsNullOrEmpty(serviceName)) args.AppendFormat(" /serviceName:{0}", serviceName);
            if (!string.IsNullOrEmpty(displayName)) args.AppendFormat(" /displayName:{0}", displayName);
            if (!string.IsNullOrEmpty(description)) args.AppendFormat(" /description:{0}", description);
            if (startManually) args.Append(" /startManually");

            _task = new RemoteCommandLineTask(exeName)
            {
                Args = args.ToString(),
                ExecutableIsLocatedAt = location,
                Machine = site.Name,
                WorkingDirectory = location
            };
        }
开发者ID:oriacle,项目名称:dropkick,代码行数:31,代码来源:RemoteNServiceBusInstallTask.cs

示例10: RegisterRealTasks

        public override void RegisterRealTasks(PhysicalServer site)
        {
            string to = site.MapPath(_to);

            var o = new CopyFileTask(_from, to, _newFileName, new DotNetPath());
            site.AddTask(o);
        }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:ProtoCopyFileTask.cs

示例11: CopyRemoteOut

        public CopyRemoteOut(PhysicalServer server)
        {
            _server = server;

            //copy remote out
            //TODO: make this path configurable
            var remotePath = RemotePathHelper.Convert(server, @"C:\Temp\dropkick.remote");
            if (!Directory.Exists(remotePath)) Directory.CreateDirectory(remotePath);
            _path = remotePath;

            var ewd = Assembly.GetExecutingAssembly().Location;
            var local = Path.GetDirectoryName(ewd);

            if (local == null) throw new Exception("shouldn't be null");

            var filesToCopy = new[] { "dropkick.remote.exe", "dropkick.dll", "log4net.dll", "Magnum.dll" };
            foreach (var file in filesToCopy)
            {
                var dest = Path.Combine(remotePath, file);
                var src = Path.Combine(local, file);
                _fineLog.DebugFormat("[msmq][remote] '{0}'->'{1}'", src, dest);

                try
                {
                    if(!File.Exists(dest))
                        File.Copy(src, dest, true);
                }
                catch (IOException ex)
                {
                    _fineLog.DebugFormat("[msmq][remote][file] Error copying '{0}' to '{1}'", file, remotePath);
                    throw;
                }

            }
        }
开发者ID:oriacle,项目名称:dropkick,代码行数:35,代码来源:CopyRemoteOut.cs

示例12: RemoteTopshelfTask

        public RemoteTopshelfTask(string exeName, string location, string instanceName, PhysicalServer site, string username, string password)
        {
            string args = string.IsNullOrEmpty(instanceName)
                              ? ""
                              : " /instance:" + instanceName;

            if (username != null && password != null)
            {
                var user = username;
                var pass = password;
                if (username.ShouldPrompt())
                    user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName));
                if (password.ShouldPrompt())
                    pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username));

                args += " /username:{0} /password:{1}".FormatWith(user, pass);
            }

            _task = new RemoteCommandLineTask(exeName)
                        {
                            Args = "install" + args,
                            ExecutableIsLocatedAt = location,
                            Machine = site.Name,
                            WorkingDirectory = location
                        };
        }
开发者ID:GorelH,项目名称:dropkick,代码行数:26,代码来源:RemoteTopshelfTask.cs

示例13: FindCertificateBy

        public static X509Certificate2 FindCertificateBy(string thumbprint, StoreName storeName, StoreLocation storeLocation, PhysicalServer server, DeploymentResult result)
        {
            if (string.IsNullOrEmpty(thumbprint)) return null;

            var certstore = new X509Store(storeName, storeLocation);

            try
            {
                certstore.Open(OpenFlags.ReadOnly);

                thumbprint = thumbprint.Trim();
                thumbprint = thumbprint.Replace(" ", "");

                foreach (var cert in certstore.Certificates)
                {
                    if (string.Equals(cert.Thumbprint, thumbprint, StringComparison.OrdinalIgnoreCase) || string.Equals(cert.Thumbprint, thumbprint, StringComparison.InvariantCultureIgnoreCase))
                    {
                        return cert;
                    }
                }

                result.AddError("Could not find a certificate with thumbprint '{0}' on '{1}'".FormatWith(thumbprint, server.Name));
                return null;
            }
            finally
            {
                certstore.Close();
            }
        }
开发者ID:Allon-Guralnek,项目名称:dropkick,代码行数:29,代码来源:BaseSecurityCertificatePermissionsTask.cs

示例14: RegisterRealTasks

        public override void RegisterRealTasks(PhysicalServer site)
        {
            string filePath = site.MapPath(_filePath);

            var o = new XmlPokeTask(filePath, _items, _setOrInsertItems, _removeItems, new DotNetPath(), _namespacePrefixes);
            site.AddTask(o);
        }
开发者ID:Allon-Guralnek,项目名称:dropkick,代码行数:7,代码来源:ProtoXmlPokeTask.cs

示例15: RegisterRealTasks

        public override void RegisterRealTasks(PhysicalServer server)
        {
            var ub = new UriBuilder("msmq", server.Name) {Path = _queueName};

            if(server.IsLocal) server.AddTask(new CreateLocalMsmqQueueTask(server, new QueueAddress(ub.Uri), _queueOptions.transactional));
            else server.AddTask(new CreateRemoteMsmqQueueTask(server, new QueueAddress(ub.Uri), _queueOptions.transactional));
        }
开发者ID:GorelH,项目名称:dropkick,代码行数:7,代码来源:ProtoMsmqTask.cs


注:本文中的PhysicalServer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。