The MoveDown method moves the specified User-Agent mapping one step down the list of User-Agent mappings, which corresponds to the order in which the User-Agent mappings are tested to find a mapping that matches the User-Agent header in a request. If the first mapping in the list does not match the User-Agent header in a request, the second mapping is tested, and so on.
HRESULT MoveDown( [in] long index );
Required. Index (the current position indicated by the Order property of the IFPCUserAgentMapping interface) of the User-Agent mapping to move down.
Sub MoveDown( _ ByVal index As Long _ )
Required. Index (the current position indicated by the Order property of the FPCUserAgentMapping object) of the User-Agent mapping to move down.
This method has no return values. If the call is unsuccessful, an error is raised that can be intercepted by using an error handler.
Option Explicit ' Define the constant needed. Const Error_TypeMismatch = &HD const Error_InvalidParameter = &H80070057 Main(WScript.Arguments) Sub Main(args) If(args.Count <> 1) Then Usage() Else MoveDownMapping args(0) End If End Sub Sub MoveDownMapping(mappingId) ' Create the root object. Dim root ' The FPCLib.FPC root object Set root = CreateObject("FPC.Root") ' Declare the other objects needed. Dim isaArray ' An FPCArray object Dim mappings ' An FPCUserAgentMappings collection ' Get references to the array object and ' the User-Agent mappings collection. Set isaArray = root.GetContainingArray() Set mappings = isaArray.RuleElements.UserAgentMappings ' Move down the specified User-Agent mapping. On Error Resume Next mappings.MoveDown(CInt(mappingId)) If Err.Number = Error_TypeMismatch Then WScript.Echo "The Mapping parameter specified is not a number." WScript.Quit ElseIf Err.Number = Error_InvalidParameter Then WScript.Echo "The mapping specified cannot be moved or does not exist." WScript.Quit Else WScript.Echo "Moving the User-Agent mapping specified down..." End If On Error GoTo 0 ' Save the changes to the collection of User-Agent mappings. mappings.Save WScript.Echo "Done!" End Sub Sub Usage() WScript.Echo "Usage:" & VbCrLf _ & " " & WScript.ScriptName & " Mapping" & VbCrLf _ & "" & VbCrLf _ & " Mapping Number of the mapping." WScript.Quit End Sub
Use the MoveUp method to move a User-Agent mapping one step up the list of User-Agent mappings.
Client | Requires Windows Vista or Windows XP. |
---|---|
Server | Requires Windows Server 2008. |
Version | Requires Forefront Threat Management Gateway (TMG). |
IDL |
Declared in Msfpccom.idl. |
DLL |
Requires Msfpccom.dll. |
Send comments about this topic to Microsoft
Build date: 11/30/2009
© 2008 Microsoft Corporation. All rights reserved.