CHFire is an ActiveX component for the basic control of windows Firewal

Description The Control allows you to add Ports and Programs to windows Firewall. The Ports, Applications and servers can be returned as a comma delimited string showing open and closed ports. The string returned can be formatted to include HTML to allow web based tables.
Methods

Addport

Adds and Opened Firewall Port

object.addport(PortDescription, PortNumber,
ProtocolType)

PortDescription

String

Portnumber

Integer

ProtocolType


Integer

2 = Any, 6 = TCP, 17 = UDP

Returns

Boolean

True On Success
Removeport
Removes a Firewall Port

object.removeport(PortNumber)

Portnumber

Integer

Returns

Boolean

True On Success
Listports
Lists Ports that are open or closed.
String return is delimited by a comma (Optional)

object.listport

Returns

String
Addprogram
Adds a program to the Firewall

object.addprogram(ProgramDescription,ProgramPath)

ProgramDescription

String

ProgramPath

String


(”c:\mydirector\myprogram.exe”)

Returns


Boolean

True On Success
Removeprogram
Removes A program from the Firewall

object.removeprogram(ProgramPath)

ProgramPath

String

(”c:\mydirector\myprogram.exe”)

Returns

Boolean

True On Success
Listapplications
Lists Programs that are open or closed.
String return is delimited by a comma (Optinal)

object.listapplications

Returns

String
Listservices
Lists Services that are open or closed.
String return is delimited by a comma (Optinal)

object.listservices

Returns

String
Parameters
Appendstart
Adds Text to the start of returned
string. Applicable to Listports, listapplications,
listservices

object.appendstart = “mystring”

Returns

String

When listing services or open ports the string
returned is normally delimited by a comma. The
string returned is made up of “Name/Port number +
“open/close” + delimiter. The delimiter can be any
string and is set using the delimiter property.

However if over formatting is required i.e for
returning HTML the string can be broken down into
three areas.

appendstart + “Name/Port number + appendmid +
“open/close” + appendend

By setting the different properties different
formats can be returned. The delimiter property is
ignored when appendstart and appendend is used.

For Example a Results HTML table


object.appendstart = “<tr><td>”

object.appendmid = “</td><td>”

object.appendend = “</td></tr>”

If appendstart and appendend is blank and
appendmid contains a string the delimiter is also
included.

“Name/Port number + appendmid + “open/close” +
delimiter

Appendmid
Adds Text to the middle of returned
string. Applicable to Listports, listapplications,
listservices

object.appendmid = “mystring”

Returns

String
Appendend
Adds Text to the End of returned string.
Applicable to Listports, listapplications, listservices

object.appendend = “mystring”

Returns

String
Delimiter
Changes the delimiter used from a comma
to


“mystring”

object.delimiter = “mystring”

Returns

String
Isactive

Return True if Firewall is on or False if Off

object.isactive


Returns

Boolean

Notifyactive
Indicates whether interactive firewall
notifications are disabled. Return True if On

object.notifyActive

Returns

Boolean
Lasterror
Returns the last error encounted

object.lasterror

Returns


String
Example
Visual Basic Dim fire As Object

fire = CreateObject(”Chfire.Winfire”)

RichTextBox1.Text = fire.listapplications

FoxPro fire = CreateObject(’Chfire.Winfire’)

thisform.edit1.value = fire.listapplications

Delphi var
fire : olevariant;

begin

Try

fire := CREATEoleOBJECT(’Chfire.Winfire’);

fire.delimiter := char(13) + char(10);

memo1.Text:= fire.listapplications;

finally

fire := VarNull;

end;

end;

Google ads