Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: Khurram Tahir
  Where is Khurram Tahir?
 Karachi
 Pakistan
 Khurram Tahir
 Tags
Subject: RE: Set default to in Multiuser
Thread ID: 331393 Message ID: 331420 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 Category: Projects and Design
Date: Thursday, December 29, 2011 7:24:54 PM         
   


> >
> >
> > Hi,
> > If you want to test things why not ping the router or server IP address?
> > If you ping the server the router must be up as the server I expect is connected to the router or a switch off of the router.
> >
> > Below are two VFP ping functions to review:
> >
> >
* --- Ping.prg
> > * --- Syntax: = PING("cServerName")
> > *--- Returns a .T., or a .F.
> > FUNCTION Ping
> > PARAMETERS mPc
> > LOCAL mCommand, Ret, mStr,cfile,RunOBJ
> > Ret = .F.
> > cfile=sys(3)
> > mCommand = Getenv("ComSpec") + " /C ping " + ALLTRIM(mPc)+ [ -n 1 -l 1 -w 1 > "]+cfile+["]
> > RunOBJ = Createobject("wscript.shell")
> > = RunOBJ.Run(mCommand,0,.T.)
> > IF FILE(cfile)
> >   mStr = FileToStr(cfile)
> >   Ret = IIF([Reply from] $ mStr,.T.,.F.)
> > ENDIF
> > * --- Remove the ping capture file.
> > DELETE FILE 
> > RETURN Ret

> >
> > Here is another version of a Ping() function using Windows API call and targeting the IP address instead of a server name.
> >
* --- PingAPI.prg - Coded as a function.
> > * --- Format : = PingAPI("10.162.15.75")
> > LPARAMETERS lChkIP
> > DECLARE INTEGER GetRTTAndHopCount IN Iphlpapi;
> > INTEGER DestIpAddress, LONG @HopCount,;
> > INTEGER MaxHops, LONG @RTT
> > 
> > DECLARE INTEGER inet_addr IN ws2_32 STRING cp
> > 
> > LOCAL nHop, nRTT
> > nIPDest = inet_addr(lChkIP)
> > IF GetRTTAndHopCount(nIPDest, @nHop, 50, @nRTT) <> 0
> >   RETURN .T.
> > ELSE
> >   RETURN .F.
> > ENDIF

> >
> > Pete "the IceMan", from the Great White North of Canada.
> > www.marathongriffincomputers.com
>
> Thanx for your methods
>
> Here in this case IP is not fix set on Auto setting of TCP/IP of Local Area Connection
>
> Please guide that how can check that Program is Running from Server or from Workstations on that use D: or M: for setting Set default to
>
> Using Free Tables NOT DBC


Hi,
One way is to go into the network properties on your server and make the IP address static so it never changes. So if your network DHCP router is set to give out IP adresses in the 192.168.0.100 to 192.168.199 range set your server to say a static IP address of 192.168.0.20. Make sure this IP address is not used anywhere else and you can do this by simply opening up a MS-DOS window and issue ping 192.168.0.20 and see if you get a reply. If you do not get a reply you know this IP address is not being used.
Checking if the program is running on the server is not going to help you and the program is not running on the server, the VFP exe is running on your local workstation if you can connect to the server. I am assuming your VFP exe resides on a server network share?

Pete "the IceMan", from the Great White North of Canada.
www.marathongriffincomputers.com

ENTIRE THREAD

Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 4:53:49 PM
RE: Set default to in Multiuser Posted by tushar @ 12/29/2011 5:00:03 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 5:03:37 PM
RE: Set default to in Multiuser Posted by tushar @ 12/29/2011 5:24:30 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 5:33:44 PM
RE: Set default to in Multiuser Posted by tushar @ 12/29/2011 5:38:34 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 6:06:09 PM
RE: Set default to in Multiuser Posted by tushar @ 12/29/2011 7:42:31 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/30/2011 3:49:13 AM
RE: Set default to in Multiuser Posted by tushar @ 12/30/2011 5:25:45 AM
RE: Set default to in Multiuser Posted by Koen Piller @ 12/29/2011 5:43:40 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 6:11:49 PM
RE: Set default to in Multiuser Posted by Koen Piller @ 12/29/2011 6:23:57 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 6:44:27 PM
RE: Set default to in Multiuser Posted by Koen Piller @ 12/29/2011 7:13:52 PM
RE: Set default to in Multiuser Posted by Jun Tangunan @ 12/30/2011 4:28:13 AM
RE: Set default to in Multiuser Posted by Pete Sass @ 12/29/2011 6:48:16 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/29/2011 7:00:52 PM
RE: Set default to in Multiuser Posted by Pete Sass @ 12/29/2011 7:24:54 PM
RE: Set default to in Multiuser Posted by Jun Tangunan @ 12/30/2011 4:15:56 AM
RE: Set default to in Multiuser Posted by Pete Sass @ 12/29/2011 7:47:07 PM
RE: Set default to in Multiuser Posted by Khurram Tahir @ 12/30/2011 4:17:36 AM
RE: Set default to in Multiuser Posted by Gordon King @ 12/30/2011 8:24:36 AM
RE: Set default to in Multiuser Posted by Gordon King @ 12/29/2011 8:47:35 PM
RE: Set default to in Multiuser Posted by Suresh Adhikari @ 12/30/2011 12:46:27 PM