Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IP Address
Message
De
17/01/2005 17:03:32
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
00977861
Message ID:
00977869
Vues:
35
local lcTempFile, loWSH, lcLocalIP
lcTempFile="LocalIP.txt"
if file(lcTempfile)		&&erase leftovers from old run
  erase (lcTempFile)
endif
loWSH=CreateObject("Wscript.Shell")
loWSH.run("command /c ipconfig > "+lcTempfile,0,1)
if file(lcTempFile)		&&read the file and parse it
  lcLocalIP=upper(filetostr(lcTempFile))
  lcLocalIP=substr(lcLocalIP, at('IP ADDRESS',lcLocalIP))
  lcLocalIP=substr(lcLocalIP, at(':',lcLocalIP)+2)
  lcLocalIP=substr(lcLocalIP, 1, at(chr(13),lcLocalIP)-1)
  messagebox(lcLocalIP)
endif
or
PUBLIC IPSocket
crlf=CHR(13)+CHR(10)
IPSocket = CREATEOBJECT("MSWinsock.Winsock")
IF TYPE('IPSocket')='O'
	IPAddress = IPSocket.LocalIP
	localhostname=IPSocket.localhostname
	remotehost=IPSocket.remotehost
	remotehostip=IPSocket.remotehostip
	MESSAGEBOX ("Local IP = " + IPAddress+crlf+"local host = "+localhostname;
		+crlf+"Remotehost = "+remotehost+crlf+"Remotehostip = "+remotehostip)
ELSE
        MESSAGEBOX('Unable to determine IP Address')
ENDIF
>how to know the IP addres of the box.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform