Foxpro Winsock Example

I need example source code in Visual FoxPro, for connect a client with a server in a remote computer via a TCP port, using MS WinSock OCX. I'd like to be able to send and receive some data. Thanks in advance. Winsock Visual Foxpro Software StelsDBF - fast DBF JDBC driver (dBase, XBase, Visual FoxPro) v.5.1 StelsDBF is a DBF JDBC type 4 driver that allows to perform SQL queries and other JDBC operations on DBF files (dBase III/ IV/ V, xBase, Visual FoxPro ). Manage Winsock and send Emails with Visual FoxPro. Specifications Examples. Sending e-mails with Visual Foxpro (The download includes a form that allows generating sample code) Hello World. SET PROCEDURE TO VFPwinsock o=CREATEOBJECT('VFPWinsockSendMail') o.SMTPHOST = 'smtp.serveur.com' o.FROM =. I have been trying to run the Http Listener in a program but cannot use it as the ports are locked under the User options. I have been looking into using a winsock option (AxWinsock) in place of the listener. I have got the main part of the program modified but are finding it hard to get. Hi, I think you can use System.Net.Socket, it is bettter.

WinsockI got this very nice solution that uses Windows API calls on this newsgroup
about two years ago. I found that the winsock example didn't work reliably.

*-- IPAddress : Allows developer to retrieve the
*-- IP Addresses and subnet masks on
*-- a system.
*-
*-- Copyright ? 2001 - RCS Solutions, Inc.
*-- Written by: Paul Mrozowski
*-- 11/4/2000

Vb6 winsock example

DEFINE CLASS IPAddress AS CUSTOM
*-- # of entries in the IP Address table
nEntries = 0
IPAddress = (SPACE(0))
SubnetMask = (SPACE(0))
Name = 'IPAddress'

PROTECTED PROCEDURE Init()
DECLARE INTEGER GetIpAddrTable IN Iphlpapi ;
INTEGER BORDER
ENDPROC

PROCEDURE GetIPAddress
LPARAMETER tnEntry
LOCAL pdwSize, pIpAddrTable, lnStructSize, ;
lnOffset, lnIPNum, lnSubNum, lnEntries, ;
lcAddr

lnOffset = 5
lnStructSize = 24
pdwSize = 0
pIpAddrTable = ' '

IF VARTYPE(tnEntry) = 'N'
pIpAddrTable = SPACE(pdwSize)
lcAddr = SUBSTR(pIpAddrTable, 1, 4)

lnEntries = THIS.ConvertDWORDtoNum(lcAddr)
THIS.nEntries = lnEntries
IF tnEntry <= lnEntries - 1
lnIPNum = SUBSTR(pIpAddrTable, (tnEntry * lnStructSize) + lnOffset, 4)
THIS.IPAddress = THIS.ConvertToDot(lnIPNum)
lnSubNum = SUBSTR(pIpAddrTable, (tnEntry * lnStructSize) + lnOffset +
8, 4)
THIS.SubnetMask = THIS.ConvertToDot(lnSubNum)
ENDIF
ENDIF

RETURN THIS.IPAddress
ENDPROC

*-- Convert the passed in # to IP address 'dot' format
PROTECTED PROCEDURE ConvertToDot
LPARAMETER tcDWORD
LOCAL lcByte0, lcByte1, lcByte2, lcByte3, lcIP

lcIP = '
IF VARTYPE(tcDWORD) = 'C'
lcByte0 = ASC(tcDWORD)
lcByte1 = ASC(SUBSTR(tcDWORD, 2, 1))
lcByte2 = ASC(SUBSTR(tcDWORD, 3, 1))
lcByte3 = ASC(SUBSTR(tcDWORD, 4, 1))

lcIP = ALLTRIM(STR(lcByte0)) + '.' ;
+ ALLTRIM(STR(lcByte1)) + '.' ;
+ ALLTRIM(STR(lcByte2)) + '.' ;
+ ALLTRIM(STR(lcByte3))
ENDIF
RETURN lcIP
ENDPROC

PROTECTED PROCEDURE ConvertDWORDtoNum
LPARAMETER tcDWORD
LOCAL lcByte0, lcByte1, lcByte2, lcByte3, lnResult

IF VARTYPE(tcDWORD) = 'C'
lnResult = 0
lcByte0 = ASC(tcDWORD)
lcByte1 = ASC(SUBSTR(tcDWORD, 2, 1))
lcByte2 = ASC(SUBSTR(tcDWORD, 3, 1))
lcByte3 = ASC(SUBSTR(tcDWORD, 4, 1))

lnResult = (((lcByte3 * 256 + lcByte2) * ;
256 + lcByte1) * 256 + lcByte0)
ENDIF
RETURN lnResult
ENDPROC

PROCEDURE nEntries_access
THIS.GetIPAddress(0)
RETURN THIS.nEntries
ENDPROC

ENDDEFINE

Example

Winsock Server Example


> Is there an API call to read the current IP address of the dialup
Foxpro > connection?

Winsock Programming

> VFP 5 Win2Ksp3

Winsock Tutorial

Winsock

Excel Vba Winsock Example


Foxpro Winsock Examples

> TIA,
> jrg

Comments are closed.