<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.win32service.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.win32-delete-service.php',
    1 => 'win32_delete_service',
    2 => 'Deletes a service entry from the SCM database',
  ),
  'up' => 
  array (
    0 => 'ref.win32service.php',
    1 => 'win32service 函数',
  ),
  'prev' => 
  array (
    0 => 'function.win32-create-service.php',
    1 => 'win32_create_service',
  ),
  'next' => 
  array (
    0 => 'function.win32-get-last-control-message.php',
    1 => 'win32_get_last_control_message',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/win32service/functions/win32-delete-service.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.win32-delete-service" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">win32_delete_service</h1>
  <p class="verinfo">(PECL win32service &gt;=0.1.0)</p><p class="refpurpose"><span class="refname">win32_delete_service</span> &mdash; <span class="dc-title">Deletes a service entry from the SCM database</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.win32-delete-service-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>win32_delete_service</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$servicename</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$machine</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>


  <p class="para rdfs-comment">
   Attempts to delete a service from the SCM database.  Administrative
   privileges are required for this to succeed.
  </p>
  <p class="para">
   This function really just marks the service for deletion.  If other
   processes (such as the Services Applet) are open, then the deletion will be
   deferred until those applications are closed.  If a service is marked for
   deletion, further attempts to delete it will fail, and attempts to create a
   new service with that name will also fail.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.win32-delete-service-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">servicename</code></dt>
     <dd>
      <p class="para">
       The short name of the service.
      </p>
     </dd>
    
    
     <dt><code class="parameter">machine</code></dt>
     <dd>
      <p class="para">
       The optional machine name.  If omitted, the local machine will be used.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.win32-delete-service-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
  <p class="para">
    Prior to version 1.0.0,  成功时返回 <strong><code><a href="win32service.constants.php#constant.win32-no-error">WIN32_NO_ERROR</a></code></strong>，参数错误时返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>，或失败时返回一个 <a href="win32service.constants.php#win32service.constants.errors" class="link">Win32 错误码</a>。
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.win32-delete-service-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
    A <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> is thrown if the
    value of <code class="parameter">servicename</code> parameter is empty.
  </p>

   <p class="para">
    A <span class="classname"><a href="class.win32serviceexception.php" class="classname">Win32ServiceException</a></span> is thrown on error.
   </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.win32-delete-service-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        Throws a <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> on invalid data in parameters,
        previously <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> was returned.
       </td>
      </tr>

      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        Throws a <span class="classname"><a href="class.win32serviceexception.php" class="classname">Win32ServiceException</a></span> on error,
        previously a 
        <a href="win32service.constants.php#win32service.constants.errors" class="link">Win32 Error Code</a>
        was returned.
       </td>
      </tr>

      <tr>
       <td>PECL win32service 1.0.0</td>
       <td>
        The return type is now <span class="type"><span class="type"><a href="language.types.void.php" class="type void">void</a></span></span>, previously it was <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.win32-delete-service-examples">
  <h3 class="title">示例</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>示例 #1 A <span class="function"><strong>win32_delete_service()</strong></span> example</strong></p>
    <div class="example-contents"><p>
     Deletes the dummyphp service.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />win32_delete_service</span><span style="color: #007700">(</span><span style="color: #DD0000">'dummyphp'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.win32-delete-service-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.win32-create-service.php" class="function" rel="rdfs-seeAlso">win32_create_service()</a> - Creates a new service entry in the SCM database</span></li>
    <li><a href="win32service.constants.php#win32service.constants.errors" class="link">Win32 Error Codes</a></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>