Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
614 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  convertion string to InetAddress

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

convertion string to InetAddress

n°1734865
progm
Posté le 20-05-2008 à 22:17:04  profilanswer
 

J’ai réalisé une application client-serveur_UDP, l’utilisateur fait entré l’adresse IP dans un JTextField....
Je veut convertir l’adresse IP qui était dans le  JTextField (elle est de type String) en InetAddress  
 :ouch:  Aide SVP  :ouch:

mood
Publicité
Posté le 20-05-2008 à 22:17:04  profilanswer
 

n°1734996
flo850
moi je
Posté le 21-05-2008 à 08:31:09  profilanswer
 

Citation :

getByName
 
public static InetAddress getByName(String host)
                             throws UnknownHostException
 
    Determines the IP address of a host, given the host's name.
 
    The host name can either be a machine name, such as "java.sun.com", or a textual representation of its IP address. If a literal IP address is supplied, only the validity of the address format is checked.
 
    For host specified in literal IPv6 address, either the form defined in RFC 2732 or the literal IPv6 address format defined in RFC 2373 is accepted.
 
    If the host is null then an InetAddress representing an address of the loopback interface is returned. See RFC 3330 section 2 and RFC 2373 section 2.5.3.
 
    Parameters:
        host - the specified host, or null.  
    Returns:
        an IP address for the given host name.  
    Throws:
        UnknownHostException - if no IP address for the host could be found.  
        SecurityException - if a security manager exists and its checkConnect method doesn't allow the operation
 


---------------


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  convertion string to InetAddress

 

Sujets relatifs
Pourquoi Boost n'implemente pas sa class STRING ?Retourner string sans allocation dynamique
convertion fichie avi en flv ffmpegconversion integer ->string
Creer une class via une stringSQL récupération d'une partie de string (un explode en sql?)
retourner un tableau de string!Comparaison et Remplacement String
String not declared malgré le #include <string>Separer les mots d'un string, sans les couper
Plus de sujets relatifs à : convertion string to InetAddress


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR