Ping??????

الموضوع في 'أرشيف المنتدى التعليمي' بواسطة amine1988, بتاريخ ‏29 مارس 2009.

  1. amine1988

    amine1988 عضو مميز

    إنضم إلينا في:
    ‏22 جوان 2007
    المشاركات:
    950
    الإعجابات المتلقاة:
    509
      29-03-2009 20:00
    :besmellah1:
    est ce que je peus avoir un code java qui permet de tester si un service apache installer sur la machine locale est actif ou non
    c a dire si j'execute le code il me renvois un message qui dit apache est actif ou un message d'inactivité
    merci
    :satelite:
     
  2. marouene

    marouene عضو نشيط

    إنضم إلينا في:
    ‏2 ديسمبر 2005
    المشاركات:
    124
    الإعجابات المتلقاة:
    55
      30-03-2009 10:08
    :besmellah1:
    كود (text):
    /*
     * $HeadURL$
     * $Revision$
     * $Date$
     *
     * ====================================================================
     * Licensed to the Apache Software Foundation (ASF) under one
     * or more contributor license agreements.  See the NOTICE file
     * distributed with this work for additional information
     * regarding copyright ownership.  The ASF licenses this file
     * to you under the Apache License, Version 2.0 (the
     * "License"); you may not use this file except in compliance
     * with the License.  You may obtain a copy of the License at
     *
     *   http://www.apache.org/licenses/LICENSE-2.0
     *
     * Unless required by applicable law or agreed to in writing,
     * software distributed under the License is distributed on an
     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     * KIND, either express or implied.  See the License for the
     * specific language governing permissions and limitations
     * under the License.
     * ====================================================================
     *
     * This software consists of voluntary contributions made by many
     * individuals on behalf of the Apache Software Foundation.  For more
     * information on the Apache Software Foundation, please see
     * <http://www.apache.org/>.
     *
     */

    package org.apache.http.examples.client;

    import org.apache.http.client.ResponseHandler;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpGet;
    import org.apache.http.impl.client.BasicResponseHandler;
    import org.apache.http.impl.client.DefaultHttpClient;

    /**
     * This example demonstrates the use of the [email protected] ResponseHandler** to simplify
     * the process of processing the HTTP response and releasing associated resources.
     */
    public class ClientWithResponseHandler {

        public final static void main(String[] args) throws Exception {
           
            HttpClient httpclient = new DefaultHttpClient();

            HttpGet httpget = new HttpGet("http://www.google.com/");

            System.out.println("executing request " + httpget.getURI());

            // Create a response handler
            ResponseHandler<String> responseHandler = new BasicResponseHandler();
            String responseBody = httpclient.execute(httpget, responseHandler);
            System.out.println(responseBody);
           
            System.out.println("----------------------------------------");

            // When HttpClient instance is no longer needed,
            // shut down the connection manager to ensure
            // immediate deallocation of all system resources
            httpclient.getConnectionManager().shutdown();        
        **
       
    **

     
    :kiss:
     
  3. amine1988

    amine1988 عضو مميز

    إنضم إلينا في:
    ‏22 جوان 2007
    المشاركات:
    950
    الإعجابات المتلقاة:
    509
      01-04-2009 13:28
    Merci mon ami mais j'ai pas compris comment fonctionne ce code
    Moi je veut un programme java complet qui permet de vérifier si le service apache installer en local est démarrer ou arreter
    merci c urgent
     

مشاركة هذه الصفحة

جاري تحميل الصفحة...