Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
IpAddress
Message
De
02/05/2006 05:56:31
 
 
À
02/05/2006 05:18:36
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01118286
Message ID:
01118306
Vues:
14
hi,
??Please don't tell me that you really want me to explain why you receive this error! &&&& ok, I don't
i fix it as under,it works

but is there another simple way?

i try via this program mac1 to get the ipadress and run my program as under

mac1.prg&& from UT(I mean the program code not the prg.name)
LOCAL oServer, oAdapters, oAdapter 

oServer = GetObject("winmgmts:\\" + "." + "\root\cimv2") 
oAdapters = oServer.ExecQuery(; 
        "SELECT * FROM Win32_NetworkAdapterConfiguration") 

CREATE CURSOR csResult (; 
        ObjectCaption C(50),; 
        Gateway C(50),; 
        IPAddress C(20),; 
        MACAddress C(20),; 
        IPXAddress C(20),; 
        ServiceName C(50),; 
        DHCPServer C(50),; 
        DNSHostName C(50); 
) 

LOCAL cGateway 

FOR EACH oAdapter IN oAdapters 
    WITH oAdapter 
        IF .IPEnabled 
         
            cGateway = IIF(ISNULL(.DefaultIPGateway), "",; 
                .DefaultIPGateway[0]) 

            INSERT INTO csResult VALUES (; 
                NVL(.Caption, ""),; 
                NVL(cGateway, ""),; 
                NVL(.IPAddress[0], ""),; 
                NVL(.MACAddress, ""),; 
                NVL(.IPXAddress, ""),; 
                NVL(.ServiceName, ""),; 
                NVL(.DHCPServer, ""),; 
                NVL(.DNSHostName, ""); 
            ) 

        ENDIF 
    ENDWITH 
NEXT 

SELECT csResult 
GO TOP 
via another program as under...it works
DO mac1
if IPaddress ="10.1.8.34      "
  do FORM main1
else
  do FORM seq
endif
thanks

>Please don't tell me that you really want me to explain why you receive this error! The error message tells you that variable Ipadress in not found, so fix it!
>
>>hi,
>>thank you , itry i got error message
>>
>>variable Ipaddress is not found
>>
>>if Ipaddress="10.1.8.34       "
>>  do FORM main1
>>else
>>  do FORM seq
>>endif
>>
>>
>>>>hi all,
>>>>
>>>>any idea ,help
>>>>
>>>>can i make if statment as
>>>>
>>>>if Ipaddress=10.1.8.34 or Ipaddress=10.1.8.30
>>>>
>>>>     do form...
>>>>else
>>>>     do form...
>>>>endif
>>>>
>>>>
>>>>thanks.
>>>
>>>You must store the IP address as text, and compare the text values. Like
>>>if Ipaddress="10.1.8.34" or Ipaddress="10.1.8.30"
>>>  do form..
>>>else
>>>  do form..
>>>endif
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform