Jack Skelley wrote on 2011-11-15:
> Tracy:
> Ok on Inno. It is on my list of things to learn. Right now just trying to
stay afloat...but sinking rapidly!
> I removed the VFP9 exception from the firewall and I ran your pasted code
in my init to the form. Windows XP did not establish a connect with the Win7
box. I put the exception back in and the connection was established. So I am
not understanding what your pasted code does.
> I would like the TCP connection to work without needing to alter the
firewall setting.
> Thanks for your time on this project.
> Regards,
>
> Jack Skelley
>
Jack,
The firewall exception is required.
This code must be run as an administrative user.
This code will need to be run ONLY ONCE, per machine.
tnName and tnPort need to be set. These are:
tnName = The name of the exception seen in the firewall settings
tnPort = The port of the exception to set (the TCP port your utility uses)
LPARAMETERS tnName, tnPort
TRY
loFWM = CreateObject("HNetCfg.FwMgr")
loProfile = loFWM.LocalPolicy.CurrentProfile
loPort = CreateObject("HNetCfg.FWOpenPort")
loPort.Name = tnName
loPort.Protocol = 6 && NET_FW_IP_PROTOCOL_TCP
loPort.Port = tnPort
loPort.Scope = 0 && NET_FW_SCOPE_ALL
loPort.Enabled = .T.
loProfile.GloballyOpenPorts.Add(loPort)
CATCH TO oEx
*-- Comment placed by Tracy Pearson on 12/22/2009
*-- Just catching an error, though we should never
*-- get here since firewall access is checked at INIT
*-- The check was added after the try/catch was in place
ENDTRY
Or in your install process, if you can call an existing EXE on the
workstation as part of the routine
C:\Windows\System32\NETSH.EXE firewall add portopening TCP tnPort "tnName"
Tracy Pearson
PowerChurch Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.