begin process at 2012 02 14 05:04:01
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Réseau & Internet

 > RÉCUPÉRER L'ADRESSE IP D'UN NOM DE DOMAINE AVEC ASP.NET

RÉCUPÉRER L'ADRESSE IP D'UN NOM DE DOMAINE AVEC ASP.NET


 Information sur la source

Note :
9,5 / 10 - par 4 personnes
9,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Réseau & Internet Source .NET ( DotNet ) Niveau :Débutant Date de création :13/05/2002 Date de mise à jour :13/05/2002 01:37:38 Vu :33 416

Auteur : Nix

Ecrire un message privé
Site perso
Ce membre participe au partage de revenus publicitaires
Commentaire sur cette source (1)
Ajouter un commentaire et/ou une note


 Description

Cliquez pour voir la capture en taille normale
Ce script en ASP.Net (en VB.net) vous permettra de récupérer l'ip d'un nom de domaine  

Source

  • <%@ Import Namespace="System" %>
  • <%@ Import Namespace="System.Net" %>
  • <%@ Import Namespace="System.Net.Sockets" %>
  • <script language="vb" runat="server">
  • Sub RecupLeIp(sender As Object, e As System.EventArgs)
  • Dim i as Integer
  • If Page.IsPostBack then
  • Try
  • Dim LeDomaine As IPHostEntry
  • LeDomaine = Dns.GetHostByName(txtDuDomain.Text)
  • lblAffiche.Text = "IP de ""<i>" & txtDuDomain.Text & "</i>"": <b>" & LeDomaine.AddressList(0).toString & "</b>"
  • Catch
  • lblAffiche.Text = "Je ne trouve pas l'hôte"
  • End Try
  • End If
  • End Sub
  • </script>
  • <html>
  • <body>
  • <font face="verdana" size="1">
  • <form runat="server" ID="MonForm">
  • Tapez le nom de domaine pour lequel vous cherchez l'ip :<br>
  • <asp:textbox id="txtDuDomain" text="www.yahoo.fr" runat="server" />
  • <asp:button id="submit" onClick="RecupLeIp" text="Récupérer l'ip" runat="server" />
  • <br>
  • <font size="2"><asp:label id="lblAffiche" text="" runat="server" /></font>
  • </form>
  • </font>
  • </body>
  • </html>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Net.Sockets" %>
<script language="vb" runat="server">
	Sub RecupLeIp(sender As Object, e As System.EventArgs)
		Dim i as Integer
		If Page.IsPostBack then
			Try
				Dim LeDomaine As IPHostEntry 
				LeDomaine = Dns.GetHostByName(txtDuDomain.Text)
				lblAffiche.Text = "IP de ""<i>" & txtDuDomain.Text & "</i>"": <b>" & LeDomaine.AddressList(0).toString & "</b>"
			Catch
				lblAffiche.Text = "Je ne trouve pas l'hôte"
			End Try
		End If
	End Sub
</script>
<html>
<body>
<font face="verdana" size="1">
<form runat="server" ID="MonForm">
	Tapez le nom de domaine pour lequel vous cherchez l'ip :<br>
	<asp:textbox id="txtDuDomain" text="www.yahoo.fr" runat="server" />
	<asp:button id="submit" onClick="RecupLeIp" text="Récupérer l'ip" runat="server" />
	<br>
	<font size="2"><asp:label id="lblAffiche" text="" runat="server" /></font>
</form>
</font>
</body>
</html>
  



 Sources du même auteur

Source avec une capture Source .NET (Dotnet) FAIRE UN HISTORGRAMME (EN GIF) À LA VOLÉE EN ASP.NET
Source .NET (Dotnet) ENVOYER UN MAIL LORSQU'UNE PAGE GÉNÈRE UNE ERREUR
Source .NET (Dotnet) RÉCUPÉRER UNE PAGE WEB À TRAVERS UNE PAGE ASP.NET
Source avec Zip UPLOADER UN FICHIER SANS COMPOSANT V2.0
CONVERTION DE DATE FRANÇAISE VERS UNE DATE ANGLAISE

 Sources de la même categorie

Source avec Zip UPLOAD ET SA GESTION VIA FSO par Caius_junioricus
Source avec Zip Source .NET (Dotnet) CLASSE AVEC QUE DES MEMBRES ET DES MÉTHODES STATIQUES POUR G... par tikrimi
Source .NET (Dotnet) ASP.NET - COMMENT OBTENIR LE CONTENU D'UNE PAGE WEB DISTANTE... par fabrice69
Source .NET (Dotnet) CLASSE .NET LISTANT LES ADRESSES MAC D'UNE MACHINE - COMPATI... par aKheNathOn
PING D'UNE LISTE DE POSTE : WHOSBAD par defrance

Commentaires et avis

Commentaire de vidjidu91 le 30/04/2008 18:09:27

salut,
C'est cool mais tu ouvre la console de windows (bouton DEMMARER+R, 'cmd') et tu tape 'ping www.yahoo.fr' et sa te met l'ip. 217.12.3.11
Sinon c'est bien quand même désolé...

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,406 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales