Microsoft Internet Security and Acceleration Server 2000 |
You can add a new filter. The following examples show language-specific code for adding a filter.
To add the filter called MyFilter, first add Microsoft Internet Security and Acceleration Server 2000 Administration Library to your Project References, then use the following code:
Dim objFPC As FPC Dim objWebFilter As FPCWebFilter Dim objWebFilters As FPCWebFilters Set objFPC = CreateObject("FPC.Root") Dim MyGuid As String MyGuid = "{2474E364-FAF1-403f-9AFE-C2A73D667447}" Dim RelativePath As String RelativePath = "Test\MyFilter\Bin\MyFilter.dll" Dim Name As String Name = "MyFilter" 'Add a new Web filter Set objWebFilter = objFPC.Arrays.GetContainingArray.Extensions.WebFilters.Add(MyGuid, Name, RelativePath, fpcFilterPriority_High, FpcFilterDirectionBoth) objWebFilter.Description = "Filter Description" objWebFilter.Name = "Filter Name" objWebFilter.Vendor = "Vendor Name" objWebFilter.Version = "1.0" objFPC.Save
To add the filter called MyFilter by using a dynamic-link library (DLL) at relative path Test\MyFilter\Bin\MyFilter.dll, open a file and name it FilterAdd.vbs. Then insert in FilterAdd.vbs the following code (where the GUID is any arbitrary GUID that is not yet associated with any other filter):
set FPC = WScript.CreateObject("FPC.Root") Set filters = FPC.Arrays.GetContainingArray.Extensions.WebFilters Set mfilter = filters.Add("{5b6f6af3-3928-44a3-90f6-c96295c51da6}", "MyFilter", " Test\MyFilter\Bin\MyFilter.dll ", 2, 2) '2 == fpcFilterPriority_High mfilter.Description = "Filter Description" mfilter.Vendor = "Filter vendor" mfilter.Version = "1.0" mfilter.Enabled = True filters.Save WScript.Echo "done"