±êÌâ: [ISA] ISA Server 2004 ÖеÄÁ´½Óת»» (²é¿´:1026 »Ø¸´:1)
rickyfang
×ܰæÖ÷

ÆóÒµÍø¹Ü¼¼Êõ/Windows²Ù×÷ϵͳ


ÏÖÒÛ°ßÖñ  
UID 399708
¾«»ª 2
»ý·Ö 903
Ìû×Ó 981
MST±Ò 5865 µã    
BST±Ò 903 µã    ×¬È¡
ÔĶÁȨÏÞ 200
×¢²á 2006-6-22
À´×Ô ±±¾©Ç廪¿Æ¼¼Ô°Çø
״̬ ÀëÏß
  ´ó ÖРС
·¢±íÓÚ 2007-6-20 23:54  [ ×ÊÁÏ ]  [ ²©¿Í ]  [ Ö÷Ò³ ] [ ¶ÌÏûÏ¢ ]  [ ¼ÓΪºÃÓÑÌí¼Ó rickyfang ΪMSNºÃÓѠͨ¹ýMSNºÍ rickyfang ½»Ì¸ QQ
°®ÇÙ˼ÓʼþϵͳiGENUS V5.0
ISA Server 2004 ÖеÄÁ´½Óת»»
±¾Ìû·¢±íÔÚÎÒÊÇÍø¹ÜÂÛ̳£¬Ìû×ÓµØÖ·£ºhttp://bbs.54master.com/172232,1,1
·¢²¼ÈÕÆÚ£º 2004Äê11ÔÂ05ÈÕ
´ÓÒÑ·¢²¼µÄ Web ·þÎñÆ÷ÉÏ·¢ËÍ»ØÍⲿ¿Í»§¶ËµÄ Web Ò³¿ÉÄÜ»áÓаüº¬ÄÚ²¿Ö÷»úÃûµÄÁ´½Ó¡£ ÓÉÓÚÍⲿ¿Í»§¶Ë²»ÄܽâÎöÕâЩÊܱ£»¤Ö÷»úµÄÃû³Æ£¬Òò´ËÕâЩÁ´½Ó»á±»×è¶Ï¡£Í¬Ê±£¬½«ÄÚ²¿Ö÷»úÃû·¢Ë͸øÍⲿ¿Í»§¶ËÒ²»áʹÕâЩÃû³Æ±©Â¶ÔÚDZÔںڿ͵ÄÍþвÏ¡£ÎªÁ˽â¾öÕâЩÎÊÌ⣬Microsoft® Internet Security and Acceleration (ISA) Server ÖÐÌṩÁËÒ»¸ö Web ¹ýÂËÆ÷£¬³ÆÎªÁ´½Óת»»¹ýÂËÆ÷¡£ÔÚÆôÓÃ´Ë Web ¹ýÂËÆ÷ʱ£¬Èç¹ûËùÖ¸¶¨µÄ¹æÔò¿ÉÒÔ½øÐÐת»»µÄÄÚÈÝÀàÐÍ×éÖаüº¬ÏìÓ¦µÄÄÚÈÝÀàÐͱêÍ·ÖÐÖ¸¶¨µÄÏûÏ¢ÕýÎÄÀàÐÍ£¬´Ë Web ¹ýÂËÆ÷¾Í»áÕë¶ÔÏàÓ¦µÄ Web ·¢²¼¹æÔò¸ù¾ÝÒ»×éĬÈϹæÔò»òÓû§¶¨ÒåµÄ´Êµä£¨ÓÃÓÚ½«°üº¬ÄÚ²¿Ö÷»úÃûµÄ×Ö·û´®Ó³ÉäΪ°üº¬¿É½âÎöÖ÷»úÃûµÄ×Ö·û´®£©½øÐÐÁ´½Óת»»¡£ ĬÈÏÇé¿öÏ£¬Á´½Óת»»½öÓ¦ÓÃÓÚ¡°HTML Îĵµ¡±ÄÚÈÝÀàÐÍ×éÖаüº¬µÄÄÚÈÝÀàÐÍ£¬¾¡¹ÜÒ²¿ÉÒÔÖ¸¶¨ÆäËûÄÚÈÝÀàÐÍ×é¡£¶ÔÓÚËùÓÐ Web ·¢²¼¹æÔòÀ´Ëµ¶¼ÊÇÕâÑù¡£Çë×¢Ò⣬ISA Server ½ö¶Ô HTML ÎĵµÖÐÖ¸¶¨Îª UCS Transformation Format 8 (UTF-8) ¸ñʽµÄ×Ö·û´®½øÐÐÁ´½Óת»»¡£
±¾Ò³ÄÚÈÝ
ÆôÓúͽûÓÃÁ´½Óת»»
Script Listing: LinkTranslation_Enable.vbs
¹ÜÀí¿Éת»»ÄÚÈÝÀàÐÍ×é
Script Listing: LinkTranslation_EditContentTypes.vbs
¹ÜÀíÁ´½Óת»»´Êµä
Script Listing: Link Translation_EditDictionary.vbs
ÆôÓúͽûÓÃÁ´½Óת»»LinkTranslation_Enable.vbs£¨½«ÔÚÏÂÃæÁгö£©ÖÐµÄ Microsoft Visual Basic® Scripting Edition (VBScript) ´úÂë»á¼ìË÷Óû§Ö¸¶¨µÄ Web ·¢²¼¹æÔòµÄÅäÖá£È»ºó£¬¸ù¾ÝÓû§ËùÖ¸¶¨µÄ²Ù×÷£¬´Ë½Å±¾»áͨ¹ýÉèÖù©Ó¦É̲ÎÊý×鹿Ôò¼¯ÖÐÁ´½Óת»»µÄ¹©Ó¦É̲ÎÊý×éÖÐµÄ Enabled ²ÎÊýÀ´Ö¸¶¨ÆôÓûò½ûÓùæÔòµÄÁ´½Óת»»£¬»òÊǸù¾Ý Enabled ²ÎÊýÀ´Ö¸³öÊÇ·ñÆôÓùæÔòµÄÁ´½Óת»»¡£
ÃüÁîÐÐÓï·¨£º
Cscript LinkTranslation_Enable.vbs  Action RuleName
Action Ö¸¶¨ÏÂÁвÙ×÷Ö®Ò»£º
ÆôÓá£ÆôÓÃÖ¸¶¨ Web ·¢²¼¹æÔòµÄÁ´½Óת»»¡£
½ûÓᣠ½ûÓÃÖ¸¶¨ Web ·¢²¼¹æÔòµÄÁ´½Óת»»¡£
״̬¡£ »ñȡָ¶¨ Web ·¢²¼¹æÔòµÄÁ´½Óת»»×´Ì¬¡£
RuleName Ö¸¶¨ Web ·¢²¼¹æÔò¡£
ÆôÓÃÖ¸¶¨ Web ·¢²¼¹æÔòµÄÁ´½Óת»»
1.
Ϊ Web ·¢²¼¹æÔò ({C202D356-5E93-4813-B737-B6f3E02C246C}) µÄÁ´½Óת»»¹©Ó¦É̲ÎÊý×éµÄÈ«¾ÖΨһ±êʶ·û (GUID) ¶¨ÒåÒ»¸ö³£Á¿¡£
2.
ÉùÃ÷Ò»¸ö FPCPolicyRule ¶ÔÏó£¬Ò»¸ö FPCVendorParametersSets ¼¯ºÏºÍÒ»¸ö FPCVendorParametersSet ¶ÔÏó¡£
3.
ͨ¹ýÒÔϲ½Ö裬µ÷ÓÃÒ»¸ö×Ó¹ý³ÌÀ´¼ìË÷ÏòÆä´«µÝÃû³ÆµÄ Web ·¢²¼¹æÔò£º
1.
´´½¨ FPC COM ¶ÔÏóµÄÒ»¸öʵÀý£¬Ê¹ÓôËʵÀý¿ÉÒÔ·ÃÎÊÆäËû ISA Server ¹ÜÀí COM ¶ÔÏó¡£
2.
ÉùÃ÷ FPCPolicyRules ¼¯ºÏ£¬»ñȡָÏòÏÖÓвßÂÔ¹æÔò¼¯ºÏµÄÒýÓá£
3.
»ñȡһ¸öÖ¸ÏòÖ¸¶¨²ßÂÔ¹æÔòµÄÒýÓ㬲¢Ê¹Óà TypeÊôÐÔ¼ì²éËüÊÇ·ñΪһ¸ö Web ·¢²¼¹æÔò¡£Èç¹û¸Ã¹æÔò²»ÊÇÒ»¸ö Web ·¢²¼¹æÔò£¬Ôò֪ͨÓû§£¬²¢Ìø¹ý´Ë¹ý³ÌµÄÆäÓಽÖè¡£
4.
»ñȡһ¸öÖ¸Ïò¹æÔòµÄ FPCVendorParametersSets ¼¯ºÏµÄÒýÓá£
5.
»ñȡһ¸öÖ¸ÏòÏÖÓÐÁ´½Óת»» FPCVendorParametersSet ¶ÔÏóµÄÒýÓ㬻òÊÇ´´½¨´Ë¶ÔÏó£¨Èç¹ûËü²»´æÔÚ£©¡£
6.
ʹÓÃÁ´½Óת»»¹©Ó¦É̲ÎÊý×é¶ÔÏóµÄ Value ÊôÐÔ½« Enabled µÄ²ÎÊýÖµÉèÖÃΪ True£¬²¢µ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Save À´±£´æËù×÷µÄ¸ü¸Ä¡£
½ûÓÃÖ¸¶¨ Web ·¢²¼¹æÔòµÄÁ´½Óת»»
1.
Ö´ÐÐÆôÓÃÁ´½Óת»»¹ý³ÌµÄ²½Öè 1 µ½²½Öè 5¡£
2.
ʹÓÃÁ´½Óת»»¹©Ó¦É̲ÎÊý×é¶ÔÏóµÄ Value ÊôÐÔ½« Enabled µÄ²ÎÊýÖµÉèÖÃΪ False£¬²¢µ÷Óà FPCVendorParametersSets ¼¯ºÏÖÐµÄ Save À´±£´æËù×÷µÄ¸ü¸Ä¡£
»ñȡָ¶¨ Web ·¢²¼¹æÔòµÄÁ´½Óת»»×´Ì¬
1.
Ö´ÐÐÆôÓÃÁ´½Óת»»¹ý³ÌµÄ²½Öè 1 µ½²½Öè 4¡£
2.
³¢ÊÔ»ñȡָÏòÏÖÓÐÁ´½Óת»» FPCVendorParametersSet ¶ÔÏóµÄÒýÓá£
3.
Èç¹ûÁ´½Óת»»²ÎÊý×é´æÔÚ£¬Ôò¼ìË÷ Enabled ²ÎÊýµÄÖµ£¬²¢¸ù¾ÝËù¼ìË÷µ½µÄÖµÏÔʾһÌõÏûÏ¢£¬Ö¸³öÊÇ·ñÆôÓÃÁËÁ´½Óת»»¡£Èç¹ûÁ´½Óת»»²ÎÊý×é²»´æÔÚ£¬ÔòÏÔʾһÌõÏûÏ¢£¬Ö¸³ö½ûÓÃÁËÁ´½Óת»»¡£

Script Listing: LinkTranslation_Enable.vbs'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Copyright (c) Microsoft Corporation. All rights reserved. ' THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE  ' RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE  ' USER. USE AND REDISTRIBUTION OF THIS CODE, WITH OR WITHOUT MODIFICATION, IS  ' HEREBY PERMITTED. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' This script retrieves the configuration of the Web publishing rule specified  ' by the user. Then, depending on the action specified by the user, the script  ' enables or disables link translation for the rule by setting the  ' TranslateLinks property of the Web publishing rule to True or False, or  ' indicates whether link translation is enabled for the rule on the basis of  ' the value of the TranslateLinks property.  ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   Option Explicit   ' ' Define a constant for the expected error. ' const Error_FileNotFound = &H80070002   Main WScript.Arguments   Sub Main(args)     Dim ruleName     Dim action       If(2 <> args.Count) Then         Usage()     End If       action = LCase(args(0))     ruleName = args(1)     Select Case action         Case "enable":             EnableLinkTranslation ruleName, True         Case "disable":             EnableLinkTranslation ruleName, False         Case "status":             GetLinkTranslationStatus ruleName         Case Else             Usage()     End Select End Sub   ' ' Enable/disable link translation for the specified Web publishing rule. ' Sub EnableLinkTranslation(ruleName, fEnableLT)     Dim wpRule     ' An FPCPolicyRule object     Dim Status     ' A string       If(fEnableLT) Then         Status = "enabled"     Else         Status = "disabled"     End If       Set wpRule = GetWebPublishingRule(ruleName)     If (wpRule.WebPublishingProperties.TranslateLinks <> fEnableLT) Then         wpRule.WebPublishingProperties.TranslateLinks = fEnableLT         wpRule.Save         WScript.Echo "Link translation has been " & Status & "."     Else         WScript.Echo "Link translation is already " & Status & "."     End If End Sub   ' ' Display the status of link translation for the specified Web Publishing rule. ' Sub GetLinkTranslationStatus(ruleName)     Dim wpRule     ' An FPCPolicyRule object     Dim Status     ' A string       Set wpRule = GetWebPublishingRule(ruleName)     If(wpRule.WebPublishingProperties.TranslateLinks = True) Then         Status = "enabled"     Else         Status = "disabled"     End If     WScript.Echo "Link translation is " & Status _         & " for the Web publishing rule " & wpRule.Name & "." End Sub   ' ' Get a Web publishing rule by name. ' Function GetWebPublishingRule(ruleName)     Dim root       ' The FPCLib.FPC root object     Dim rules      ' An FPCPolicyRules collection     Dim errorCode, errorDescript       Set root = WScript.CreateObject("FPC.Root")     Set rules = root.GetContainingArray.ArrayPolicy.PolicyRules       On Error Resume Next     Set GetWebPublishingRule = rules.Item(ruleName)     Select Case err.Number         Case Error_FileNotFound:             WScript.Echo "The Web publishing rule " & ruleName _                 & " does not exist."             WScript.quit         Case 0:             ' OK         Case Else             err.Raise err.Number,, err.Description     End Select     On error goto 0       If wpRule.Type <> fpcPolicyRuleWebPublishing Then         WScript.Echo "The policy rule " & ruleName _             & " is not a Web publishing rule."         WScript.Quit     End If End Function   Sub Usage()     WScript.Echo "Usage:" & VbCrLf _         & "  " & WScript.ScriptName & " Action RuleName" & VbCrLf _         & "" & VbCrLf _         & "    Action:" & VbCrLf _         & "      Enable  - Enable link translation for the specified rule." _                  & VbCrLf _         & "      Disable - Enable link translation for the specified rule." _                  & VbCrLf _         & "      Status  - Get the link translation status " _                  & "for the specified rule." & VbCrLf     WScript.Quit End Sub
¹ÜÀí¿Éת»»ÄÚÈÝÀàÐÍ×éÆôÓÃÁ´½Óת»»Ê±£¬ISA Server »á¼ì²éÏìÓ¦µÄÄÚÈÝÀàÐͱêÍ·£¬ÒÔÈ·¶¨ÊÇ·ñÒª½«Á´½Óת»»Ó¦ÓÃÓÚÏûÏ¢ÕýÎÄ¡£°üº¬ÄÚÈÝÀàÐͱêÍ·Ëù¶ÔÓ¦×Ö·û´®ÁбíµÄÄÚÈÝÀàÐÍ×éµÄÃû³Æ¿ÉÒÔÔÚÓëÁ´½Óת»»¹ýÂËÆ÷¹ØÁªµÄÌØ¶¨²ÎÊý×éÖÐÖ¸¶¨¡£Ä¬ÈÏÇé¿öÏ£¬Ö¸¶¨¿Éת»»ÄÚÈÝÀàÐÍʱ¿ÉÒÔʹÓÃÒÔÏÂÄÚÈÝÀàÐÍ×飺
Ó¦ÓóÌÐò
Ó¦ÓóÌÐòÊý¾ÝÎļþ
񙮵
ѹËõÎļþ
Îĵµ
HTML Îĵµ
ͼÏñ
ºêÎĵµ
Îı¾
ÊÓÆµ
VRML
ĬÈÏÇé¿öÏ£¬Á´½Óת»»½öÓ¦ÓÃÓÚ¡°HTML Îĵµ¡±ÄÚÈÝÀàÐÍ×éÖаüº¬µÄÄÚÈÝÀàÐÍ¡£
LinkTranslation_EditContentTypes.vbs ÖÐµÄ VBScript ´úÂë»á¼ìË÷ÓëÁ´½Óת»»¹ýÂËÆ÷¹ØÁªµÄ¹©Ó¦É̲ÎÊý×鼯ºÏ¡£È»ºó£¬¸ù¾ÝÓû§Ö¸¶¨µÄ²Ù×÷£¬´Ë½Å±¾½«£ºÍ¨¹ýÇå³ý¶¨Òå¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ¹©Ó¦É̲ÎÊý×éÖÐÖ¸¶¨µÄËùÓпÉת»»ÄÚÈÝÀàÐÍ×éÀ´»¹Ô­Ä¬ÈϵĿÉת»»ÄÚÈÝÀàÐÍÁÐ±í£¨¡°HTML Îĵµ¡±ÄÚÈÝÀàÐÍ×éÖаüº¬µÄÄÚÈÝÀàÐÍ£©¡¢ÏÔʾ´Ë¹©Ó¦É̲ÎÊý×éµÄ AllNames ÊôÐÔÖж¨ÒåµÄ¿Éת»»ÄÚÈÝÀàÐÍ×éµÄµ±Ç°ÁÐ±í¡¢»òÊÇÉèÖÿÉת»»ÄÚÈÝÀàÐÍ×éÁÐ±í¡£
Ó÷¨£º
[Cscript] LinkTranslation_EditContentTypes.vbs  Action [ContentTypes]
Action Ö¸¶¨ÁËÒÔϲÙ×÷Ö®Ò»£º
ÁÐ±í¡£Áгöµ±Ç°¿Éת»»ÄÚÈÝÀàÐÍ×é¡£
ĬÈÏ¡£ ÖØÖÃΪĬÈϵĿÉת»»ÄÚÈÝÀàÐÍ¡£
ÉèÖÃÀàÐÍ¡£ ÉèÖÃÖ¸¶¨µÄ¿Éת»»ÄÚÈÝÀàÐÍ×飨ÒÔ¿Õ¸ñ·Ö¸ôµÄÁÐ±í£©¡£
ContentTypes Ö¸¶¨ÄÚÈÝÀàÐÍ×é¡£
ʾÀý£º
LinkTranslation_EditContentTypes.vbs SetTypes €œHTML Documents€ Video
Áгöµ±Ç°¿Éת»»ÄÚÈÝÀàÐÍ×é
1.
ΪÁ´½Óת»»¹ýÂËÆ÷ ({9DEEF135-75DB-4aab-B2AC-314FBC98EF14}) µÄ GUID ºÍÖ¸¶¨ÁË¿Éת»»ÄÚÈÝÀàÐÍ ({E4FA56DB-7A77-4d13-B421-6641DF2D1AF0}) µÄ¹©Ó¦É̲ÎÊý×éµÄ GUID ¶¨Òå³£Á¿¡£
2.
´´½¨ FPC COM ¶ÔÏóµÄÒ»¸öʵÀý£¬ ʹÓôËʵÀý¿ÉÒÔ·ÃÎÊÆäËû ISA Server ¹ÜÀí COM ¶ÔÏó¡£
3.
»ñȡһ¸öÖ¸ÏòÓëÁ´½Óת»»¹ýÂËÆ÷¹ØÁªµÄ FPCVendorParametersSets ¼¯ºÏµÄÒýÓá£
4.
»ñȡһ¸öÖ¸ÏòÖ¸¶¨ÁË¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ FPCVendorParametersSet ¶ÔÏóµÄÒýÓá£
5.
Èç¹ûÖ¸¶¨ÁË¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×é´æÔÚ£¬Ôò¼ìË÷ÕâЩָ¶¨ÁË¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊýµÄÃû³Æ£¬²¢ÏÔʾÕâЩÃû³Æ¡£Èç¹ûÖ¸¶¨ÁË¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×é²»´æÔÚ£¬ÔòÏÔʾһÌõÏûÏ¢£¬Ö¸³ö½«½öʹÓÃĬÈϵÄÄÚÈÝÀàÐÍ¡£
ÖØÖÃΪĬÈϵĿÉת»»ÄÚÈÝÀàÐÍ
1.
Ö´ÐС°Áгöµ±Ç°¿Éת»»ÄÚÈÝÀàÐÍ×顱¹ý³ÌµÄ²½Öè 1 µ½²½Öè 3¡£
2.
ʹÓÃÖ¸¶¨¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×éµÄ GUID À´µ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Remove ·½·¨¡£
3.
Èç¹û³É¹¦É¾³ýÁËÖ¸¶¨¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×飬Ôòµ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Save À´±£´æËù×÷µÄ¸ü¸Ä¡£
ÉèÖÃΪ¿Éת»»ÄÚÈÝÀàÐÍ
1.
Ö´ÐС°Áгöµ±Ç°¿Éת»»ÄÚÈÝÀàÐÍ×顱¹ý³ÌµÄ²½Öè 1 µ½²½Öè 3¡£
2.
ʹÓÃÖ¸¶¨¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×éµÄ GUID À´µ÷Óù©Ó¦É̲ÎÊý×鼯ºÏµÄ Remove ·½·¨£¬ÒÔɾ³ý´Ë²ÎÊý×飨Èç¹ûËü´æÔÚ£©¡£
3.
ʹÓÃÖ¸¶¨¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×éµÄ GUID µÄµÚÒ»¸ö²ÎÊý×éÀ´µ÷Óù©Ó¦É̲ÎÊý×鼯ºÏµÄ Add ·½·¨£¬ÒÔ±ãΪ¿Éת»»ÄÚÈÝÀàÐÍ×é´´½¨Ò»¸öеĿղÎÊý×é¡£
4.
ÔÚij¸ö For Ñ­»·ÖУ¬¶ÔÃüÁîÐÐÖÐÖ¸¶¨µÄÿ¸ö¿Éת»»ÄÚÈÝÀàÐÍ×éµ÷Óö¨Òå¿Éת»»ÄÚÈÝÀàÐÍ×éµÄ²ÎÊý×éµÄ Value ÊôÐÔ£¬ÒԱ㽫Ãû³Æ±»ÉèÖÃΪ¿Éת»»ÄÚÈÝÀàÐÍ×éÃû³Æ¡¢Öµ±»ÉèÖÃΪ 1 µÄ²ÎÊýÌí¼Ó½øÀ´¡£
5.
µ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Save ±£´æËù×÷µÄ¸ü¸Ä¡£

Script Listing: LinkTranslation_EditContentTypes.vbs'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Copyright (c) Microsoft Corporation. All rights reserved. ' THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE  ' RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE  ' USER. USE AND REDISTRIBUTION OF THIS CODE, WITH OR WITHOUT MODIFICATION, IS  ' HEREBY PERMITTED. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' This script retrieves the collection of vendor parameters sets associated with ' Link Translation Filter. Then, depending on the action specified by the user,  ' the script reverts to the default translatable content type set (HTML  ' Documents) by clearing all the translatable content type sets specified in the ' vendor parameters set that contains the translatable content type sets,  ' displays the current list of translatable content type sets defined in the ' AllNames property of the vendor parameters set, or sets the list of  ' translatable content type sets. ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   Option Explicit ' ' Define constants for the GUIDs of Link Translation Filter and the vendor ' parameters set that specifies the translatable content type sets. ' Const LTFGUID = "{9DEEF135-75DB-4aab-B2AC-314FBC98EF14}" Const TranslatableC Const Error_FileNotFound = &H80070002   Main WScript.Arguments   Sub Main(args)     Dim root       ' The FPCLib.FPC root object     Dim vpSets     ' An FPCVendorParametersSets collection       If(0 = args.Count) Then         Usage()     End If       Set root = WScript.CreateObject("FPC.Root")     Set vpSets = _     root.GetContainingArray.Extensions.WebFilters(LTFGUID).VendorParametersSets       Select Case LCase(args(0))         Case "list":             ListTranslatableContentTypeSets vpSets         Case "default":             ' Clear the list of translatable content type sets.             RemoveFromVPSs vpSets, TranslatableContentTypeSetsGUID             WScript.Echo "Using the default translatable content types..."         Case "settypes":             If(args.Count < 2) Then                 Usage()             End If             SetTranslatableContentTypeSets vpSets, args         Case Else             Usage()     End Select End Sub     ' ' Display the current translatable content type sets. ' Sub ListTranslatableContentTypeSets(vpSets)     Dim vpSet     ' An FPCVendorParametersSet object     Dim errorCode, errorDescript, contentTypeSets, contentTypeSet       On Error Resume Next     Set vpSet = vpSets(TranslatableContentTypeSetsGUID)     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case 0             c             For Each contentTypeSet in vpSet.AllNames                 contentTypeSets = contentTypeSets & " " & contentTypeSet             Next             WScript.Echo "Translatable content type sets: " & contentTypeSets         Case Error_FileNotFound:             WScript.Echo "Using the default translatable content types only..."         Case Else             err.Raise errorCode,, errorDescript     End Select End Sub     ' ' Set specific translatable content type sets. ' Sub SetTranslatableContentTypeSets(vpSets, contentTypeSets)     Dim vpSet     ' An FPCVendorParametersSet object     Dim first, contentTypeSet       RemoveFromVPSs vpSets, TranslatableContentTypeSetsGUID     Set vpSet = vpSets.Add(TranslatableContentTypeSetsGUID, False)       first = True     For Each contentTypeSet In contentTypeSets         If(first) Then             first = False    ' Skip the first command-line parameter.         Else             vpSet.Value(contentTypeSet) = 1         End If     Next     vpSets.Save     ListTranslatableContentTypeSets vpSets End Sub     ' ' Remove the specified VendorParametersSet from VendorParametersSets collection. ' sub RemoveFromVPSs(vpSets, setName)     Dim errorCode, errorDescript       On Error Resume Next     vpSets.Remove setName     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case 0:             vpSets.Save         Case Error_FileNotFound:             ' Ignore the error. The object has already been removed.         Case Else             err.Raise errorCode,,errorDescript     End Select End Sub   sub Usage()     Dim usageText     usageText = "Usage:" & vbCrLf _         & vbCrLf  _         & "  " & wscript.ScriptName & " Action [Content Type Sets]" & vbCrLf _         & vbCrLf  _         & "    Action:"  & vbCrLf _         & "       List     - List current translatable content type sets." _                   & vbCrLf _         & "       Default  - Reset to default translatable content types."  _                   & vbCrLf _         & "       SetTypes - Set the specified translatable content type sets" _                   & " (space-delimited list)."  & vbCrLf _         & vbCrLf  _         & "    Example:"  & vbCrLf _         & "       " & wscript.ScriptName & " SetTypes Application" _                   & " ""HTML Documents"""  & vbCrLf       WScript.Echo usageText     WScript.Quit End Sub
¹ÜÀíÁ´½Óת»»´Êµäÿ¸ö Web ·¢²¼¹æÔò¶¼¿ÉÒÔÓÐ×Ô¼ºµÄÁ´½Óת»»´Êµä£¬Ëü¶¨ÒåÁËÓëÖ®¹ØÁªµÄÌØ¶¨¹©Ó¦É̲ÎÊý×é¡£´ÊµäÖеÄÿ¸öʵÌå¶¼ÊÇÒ»¸ö×Ö·û´®¶Ô£¬¸Ã×Ö·û´®¶ÔÓɰüº¬ÄÚ²¿Ö÷»úÃûµÄ×Ö·û´®ºÍ°üº¬Íⲿ¿Í»§¶Ë¿É½âÎöÖ÷»úÃûµÄ×Ö·û´®×é³É¡£ÄÚ²¿×Ö·û´®±»Ö¸¶¨Îª²ÎÊýµÄÃû³Æ£¬Íⲿ×Ö·û´®±»Ö¸¶¨ÎªËüµÄÖµ¡£
LinkTranslation_EditDictionary.vbs ÖÐµÄ VBScript ´úÂëʹµÃÓû§¿ÉÒÔ¹ÜÀí Web ·¢²¼¹æÔòµÄÁ´½Óת»»´Êµä¡£¸ù¾ÝÓû§Ö¸¶¨µÄ²Ù×÷£¬´Ë´Êµä¿ÉÒÔ£ºÁгöËùÓÐ Web ·¢²¼¹æÔòµÄÁ´½Óת»»´Êµä¡¢ÁгöÖ¸¶¨ Web ·¢²¼¹æÔòµÄ´ÊµäÖаüº¬µÄËùÓÐÄÚ²¿/Íⲿ×Ö·û´®¶Ô¡¢´ÓÖ¸¶¨¹æÔòµÄ´ÊµäÖÐɾ³ýÖ¸¶¨ÌõÄ¿¡¢É¾³ýÖ¸¶¨¹æÔòµÄÕû¸ö´ÊµäÒÔ¼°ÏòÖ¸¶¨¹æÔòµÄ´ÊµäÖÐÌí¼ÓÄÚ²¿/Íⲿ×Ö·û´®¶Ô¡£
ÃüÁîÐÐÓï·¨£º
LinkTranslation_EditDictionary.vbs Action [RuleName] [InternalString] [ExternalString]
Action Ö¸¶¨ÁËÒÔϲÙ×÷Ö®Ò»£º
È«²¿Áгö¡£ÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä¡£
Áгö¡£ ÁгöÖ¸¶¨¹æÔòµÄ´Êµä¡£
Çå³ý¡£Çå³ýÖ¸¶¨¹æÔòµÄÁ´½Óת»»´ÊµäÖеÄËùÓÐÌõÄ¿¡£
Ìí¼Ó¡£ ÏòÖ¸¶¨¹æÔòµÄ´ÊµäÖÐÌí¼Ó InternalString ºÍ ExternalString ¶¨ÒåµÄÌõÄ¿¡£
ɾ³ýʵÌå¡£ ´ÓÖ¸¶¨¹æÔòµÄ´ÊµäÖÐɾ³ý InternalString µÄʵÌå¡£
RuleName Ö¸¶¨ÁË Web ·¢²¼¹æÔò¡£
InternalString Ö¸¶¨Á˺¬ÓÐÄÚ²¿Ö÷»úÃûµÄ×Ö·û´®¡£
ExternalString Ö¸¶¨Á˺¬ÓпɽâÎöΪÍⲿÖ÷»úÃûµÄ×Ö·û´®¡£
ÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä
1.
Ϊ¶¨ÒåÁ´½Óת»»´Êµä ({3563FFF5-DF93-40eb-ABC3-D24B5F14D8AA}) µÄ¹©Ó¦É̲ÎÊý×éµÄ GUID ¶¨ÒåÒ»¸ö³£Á¿£¬²¢ÎªÃ¶¾ÙÖµ¶¨ÒåÒ»¸ö³£Á¿£¬ÒÔÖ¸³ö²ßÂÔ¹æÔòÊÇ Web ·¢²¼¹æÔò¡£
2.
´´½¨ FPC COM ¶ÔÏóµÄÒ»¸öʵÀý£¬ ʹÓôËʵÀý¿ÉÒÔ·ÃÎÊÆäËû ISA Server ¹ÜÀí COM ¶ÔÏó¡£
3.
ÉùÃ÷Ò»¸ö FPCPolicyRules ¼¯ºÏºÍÒ»¸ö FPCPolicyRule ¶ÔÏó¡£
4.
»ñȡһ¸öÖ¸ÏòÏÖÓвßÂÔ¹æÔò¼¯ºÏµÄÒýÓá£
5.
ÔÚij¸ö For Ñ­»·ÖУ¬¶Ô²ßÂÔ¹æÔò¼¯ºÏÖеÄÿ¸ö¹æÔòʹÓà Type ÊôÐÔ£¬ÒÔÈ·¶¨ËüÊDz»ÊÇÒ»¸ö Web ·¢²¼¹æÔò¡£Èç¹û²ßÂÔ¹æÔòÊÇÒ»¸ö Web ·¢²¼¹æÔò£¬Ôò¿Éͨ¹ýÒÔϲ½ÖèÀ´µ÷ÓÃÒ»¸ö×Ó¹ý³Ì£¬ÒÔÁгö²ßÂÔ¹æÔòµÄÁ´½Óת»»´ÊµäÖеÄʵÌ壺
1.
ÉùÃ÷Ò»¸ö FPCVendorParametersSets ¼¯ºÏºÍÒ»¸ö FPCVendorParametersSet ¶ÔÏó¡£
2.
»ñȡһ¸öÖ¸Ïò¹æÔòµÄ FPCVendorParametersSets ¼¯ºÏµÄÒýÓá£
3.
³¢ÊÔ»ñȡָÏò¼¯ºÏÖж¨ÒåÁ´½Óת»»´ÊµäµÄ FPCVendorParametersSet ¶ÔÏóµÄÒýÓá£
4.
Èç¹û·Ç¿ÕÁ´½Óת»»´Êµä¿É»ñÈ¡ÒýÓã¬ÔòÔÚ For Ñ­»·ÖУ¬ÔÚÏàÓ¦µÄÍⲿ×Ö·û´®Ö®ºóÏÔʾ AllNames ¼ìË÷µ½µÄÿ¸öÃû³Æ£¨ÄÚ²¿×Ö·û´®£©£¬¸ÃÍⲿ×Ö·û´®ÊÇͨ¹ýʹÓÃÄÚ²¿×Ö·û´®²ÎÊý×éÀ´µ÷Óà Value ÊôÐÔ»ñÈ¡µÄ¡£
ÁгöÖ¸¶¨ Web ·¢²¼¹æÔòµÄ´Êµä
1.
Ö´ÐС°ÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä¡±¹ý³ÌµÄ²½Öè 1 µ½²½Öè 4¡£
2.
ͨ¹ýµÚ¶þ¸öÃüÁîÐвÎÊý¼ìË÷Ö¸¶¨ Web ·¢²¼¹æÔòµÄÃû³Æ¡£
3.
»ñȡһ¸öÖ¸ÏòÖ¸¶¨²ßÂÔ¹æÔòµÄÒýÓ㬲¢Ê¹Óà TypeÊôÐÔ¼ì²éËüÊÇ·ñΪһ¸ö Web ·¢²¼¹æÔò¡£Èç¹û¸Ã¹æÔò²»ÊÇÒ»¸ö Web ·¢²¼¹æÔò£¬Ôò֪ͨÓû§²¢Ìø¹ý±¾¹ý³ÌµÄÆäÓಽÖè¡£
4.
µ÷ÓÃÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä¹ý³ÌµÄ²½Öè 5 ÖнéÉܵÄ×Ó¹ý³Ì£¬ÒÔÏÔʾ rule€™ µÄÁ´½Óת»»´ÊµäÖеÄʵÌå¡£
´ÓÖ¸¶¨¹æÔòµÄÁ´½Óת»»´ÊµäÖÐÇå³ýËùÓÐʵÌå
1.
Ö´ÐС°ÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä¡±¹ý³ÌµÄ²½Öè 1 µ½²½Öè 4¡£
2.
ͨ¹ýµÚ¶þ¸öÃüÁîÐвÎÊý¼ìË÷Ö¸¶¨ Web ·¢²¼¹æÔòµÄÃû³Æ¡£
3.
»ñȡһ¸öÖ¸ÏòÖ¸¶¨²ßÂÔ¹æÔòµÄÒýÓ㬲¢Ê¹Óà TypeÊôÐÔ¼ì²éËüÊÇ·ñΪһ¸ö Web ·¢²¼¹æÔò¡£Èç¹û¸Ã¹æÔò²»ÊÇÒ»¸ö Web ·¢²¼¹æÔò£¬Ôò֪ͨÓû§²¢Ìø¹ý±¾¹ý³ÌµÄÆäÓಽÖè¡£
4.
ÉùÃ÷Ò»¸ö FPCVendorParametersSets ¼¯ºÏºÍÒ»¸ö FPCVendorParametersSet ¶ÔÏó¡£
5.
»ñȡһ¸öÖ¸Ïò¹æÔòµÄ FPCVendorParametersSets ¼¯ºÏµÄÒýÓá£
6.
ʹÓö¨ÒåÁ´½Óת»»´ÊµäµÄ²ÎÊý×éµÄ GUID µÄ²ÎÊý×éÀ´µ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Remove ·½·¨£¬ÒÔɾ³ý´Ë²ÎÊý×飨Èç¹ûËü´æÔÚ£©¡£
7.
Èç¹û³É¹¦É¾³ýÁËÁ´½Óת»»´Êµä£¬Ôòµ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Save ±£´æËù×÷µÄ¸ü¸Ä¡£
ÏòÖ¸¶¨¹æÔòµÄÁ´½Óת»»´ÊµäÖÐÌí¼ÓʵÌå
1.
Ö´ÐС°ÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä¡±¹ý³ÌµÄ²½Öè 1 µ½²½Öè 4¡£
2.
ͨ¹ýµÚ¶þ¸öÃüÁîÐвÎÊý¼ìË÷Ö¸¶¨ Web ·¢²¼¹æÔòµÄÃû³Æ¡£
3.
»ñȡһ¸öÖ¸ÏòÖ¸¶¨²ßÂÔ¹æÔòµÄÒýÓ㬲¢Ê¹Óà TypeÊôÐÔ¼ì²éËüÊÇ·ñΪһ¸ö Web ·¢²¼¹æÔò¡£Èç¹û¸Ã¹æÔò²»ÊÇÒ»¸ö Web ·¢²¼¹æÔò£¬Ôò֪ͨÓû§²¢Ìø¹ý±¾¹ý³ÌµÄÆäÓಽÖè¡£
4.
ÉùÃ÷Ò»¸ö FPCVendorParametersSets ¼¯ºÏºÍÒ»¸ö FPCVendorParametersSet ¶ÔÏó¡£
5.
»ñȡһ¸öÖ¸Ïò¹æÔòµÄ FPCVendorParametersSets ¼¯ºÏµÄÒýÓá£
6.
³¢ÊÔ»ñȡһ¸öÖ¸Ïò¶¨ÒåÁ´½Óת»»´ÊµäµÄÏÖÓвÎÊý×éµÄÒýÓá£
7.
ʹÓö¨ÒåÁ´½Óת»»´ÊµäµÄ²ÎÊý×éµÄ GUID µÄµÚÒ»¸ö²ÎÊý×éÀ´µ÷Óù©Ó¦É̲ÎÊý×鼯ºÏµÄ Add ·½·¨£¬ÒÔ±ãΪÁ´½Óת»»´Êµä´´½¨Ò»¸öеĿղÎÊý×é¡£
8.
µ÷Óö¨ÒåÁ´½Óת»»´ÊµäµÄ²ÎÊý×éµÄ Value ÊôÐÔ£¬ÒԱ㽫ÃüÁîÐÐÖÐÖ¸¶¨ÁËÃû³Æ¡¢ÇÒÖµ±»ÉèÖÃΪÃüÁîÐÐÖÐÖ¸¶¨µÄÍⲿ×Ö·û´®µÄ²ÎÊýÌí¼Ó½øÀ´¡£
9.
µ÷Óà FPCVendorParametersSets ¼¯ºÏµÄ Save ±£´æËù×÷µÄ¸ü¸Ä¡£
´ÓÖ¸¶¨¹æÔòµÄÁ´½Óת»»´ÊµäÖÐɾ³ýʵÌå
1.
Ö´ÐС°ÁгöËùÓÐ Web ·¢²¼¹æÔòµÄ´Êµä¡±¹ý³ÌµÄ²½Öè 1 µ½²½Öè 4¡£
2.
ͨ¹ýµÚ¶þ¸öÃüÁîÐвÎÊý¼ìË÷Ö¸¶¨ Web ·¢²¼¹æÔòµÄÃû³Æ¡£
3.
»ñȡһ¸öÖ¸ÏòÖ¸¶¨²ßÂÔ¹æÔòµÄÒýÓ㬲¢Ê¹Óà TypeÊôÐÔ¼ì²éËüÊÇ·ñΪһ¸ö Web ·¢²¼¹æÔò¡£Èç¹û¸Ã¹æÔò²»ÊÇÒ»¸ö Web ·¢²¼¹æÔò£¬Ôò֪ͨÓû§²¢Ìø¹ý±¾¹ý³ÌµÄÆäÓಽÖè¡£
4.
ÉùÃ÷Ò»¸ö FPCVendorParametersSets ¼¯ºÏºÍÒ»¸ö FPCVendorParametersSet ¶ÔÏó¡£
5.
»ñȡһ¸öÖ¸Ïò¹æÔòµÄ FPCVendorParametersSets ¼¯ºÏµÄÒýÓá£
6.
³¢ÊÔ»ñȡһ¸öÖ¸Ïò¶¨ÒåÁ´½Óת»»´ÊµäµÄÏÖÓвÎÊý×éµÄÒýÓá£Èç¹û´Ë²ÎÊý×é²»´æÔÚ£¬ÔòÌø¹ý´Ë¹ý³ÌÖÐµÄÆäÓಽÖè¡£
7.
ʹÓÃÃüÁîÐÐÖÐÖ¸¶¨µÄÄÚ²¿×Ö·û´®µÄ²ÎÊý×éÀ´µ÷Óö¨ÒåÁ´½Óת»»´ÊµäµÄ²ÎÊý×éµÄ RemoveValue ·½·¨£¬ÒÔɾ³ýÖ¸¶¨µÄÌõÄ¿¡£
8.
Èç¹û³É¹¦É¾³ýÁËÌõÄ¿£¬Ôòµ÷Óà FPCVendorParametersSet ¶ÔÏóµÄ Save ±£´æËù×÷µÄ¸ü¸Ä¡£

Script Listing: Link Translation_EditDictionary.vbs'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Copyright (c) Microsoft Corporation. All rights reserved. ' THIS CODE IS MADE AVAILABLE AS IS, WITHOUT WARRANTY OF ANY KIND. THE ENTIRE  ' RISK OF THE USE OR THE RESULTS FROM THE USE OF THIS CODE REMAINS WITH THE  ' USER. USE AND REDISTRIBUTION OF THIS CODE, WITH OR WITHOUT MODIFICATION, IS  ' HEREBY PERMITTED. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Depending on the action specified by the user in the command line, this script ' lists the link-translation dictionaries of all Web publishing rules, lists all ' the entries defining internal-external pairs of strings in the dictionary for ' the specified Web publishing rule, removes the specified entry from the ' dictionary for the specified rule, removes the entire dictionary for the ' specified rule, adds an entry defining an internal-external pair to the ' dictionary for the specified rule. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''   Option Explicit   ' ' Define a constant for the GUID of the vendor parameters set that defines ' a link-translation dictionary. ' Const LinkTranslatDicGUID = "{3563FFF5-DF93-40eb-ABC3-D24B5F14D8AA}" Const fpcPolicyRuleWebPublishing = 2 Const Error_FileNotFound = &H80070002   Dim root       ' The FPCLib.FPC root object   Main Wscript.Arguments   Sub Main(args)     Dim ruleName, action       If(0 = args.Count) Then         Usage()     End If       Set root = WScript.CreateObject("FPC.Root")     action = LCase(args(0))       Select Case action         Case "listall":             ListAllDictionaries         Case "list":             If(2 > args.Count) Then                 Usage()             End If             ruleName = args(1)             ListDictionary GetWebPublishingRule(ruleName)         Case "clear":             If(2 > args.Count) Then                 Usage()             End If             ruleName = args(1)             ClearDictionary GetWebPublishingRule(ruleName)         Case "add":             If(4 > args.count) Then                 Usage()             End If             ruleName = args(1)             AddItemToDictionary GetWebPublishingRule(ruleName), args(2), args(3)         Case "removeentry":             If(3 > args.Count) Then                 Usage()             End If             ruleName = args(1)             RemoveEntry GetWebPublishingRule(ruleName), args(2)         case Else             Usage()      End Select End Sub     ' ' List the dictionaries of all Web publishing rules. ' Sub ListAllDictionaries()     Dim rules     ' An FPCPolicyRules collection     Dim rule      ' An FPCPolicyRule object       Set rules = root.GetContainingArray.ArrayPolicy.PolicyRules     For Each rule in rules         If rule.Type = fpcPolicyRuleWebPublishing Then             ListDictionary rule         End If     Next End Sub     ' ' List the content of the link-translation dictionary for the  ' specified Web publishing rule. ' Sub ListDictionary(wpRule)     Dim vpSets    ' An FPCVendorParametersSets collection     Dim vpSet     ' An FPCVendorParametersSet object     Dim errorCode, errorDescript, index, name       Set vpSets = wpRule.VendorParametersSets       On Error Resume Next     Set vpSet = vpSets(LinkTranslatDicGUID)     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case Error_FileNotFound:             WScript.Echo "The dictionary for the " & wpRule.Name _             & " rule is empty or does not exist."          Case 0:             ' A dictionary exists for this rule.             WScript.Echo "Dictionary for the " & wpRule.Name & " rule:"             index = 1             If(IsEmpty(vpSet.AllNames)) Then                     WScript.Echo "   The dictionary is empty."             Else                 For Each name In vpSet.AllNames                     WScript.Echo "   " & index & ". " & name & " - " & _                                  vpSet.Value(name)                     index = index + 1                 Next             End If         Case Else:             err.Raise errorCode,, errorDescript       End Select End Sub     ' ' Remove the vendor parameters set defining the link-translation dictionary ' of the specified Web publishing rule. ' Sub ClearDictionary(wpRule)     Dim vpSets    ' An FPCVendorParametersSets collection       Set vpSets = wpRule.VendorParametersSets     RemoveFromVPSs vpSets, LinkTranslatDicGUID     vpSets.Save End Sub     ' ' Remove a single entry from the dictionary (The entry name is the internal  ' string). ' Sub RemoveEntry(wpRule, name)     Dim vpSets    ' An FPCVendorParametersSets collection     Dim vpSet     ' An FPCVendorParametersSet object     Dim errorCode, errorDescript       ' Get the vendor parameters set defining the link-translation dictionary.     Set vpSets = wpRule.VendorParametersSets     On Error Resume Next     Set vpSet = vpSets(LinkTranslatDicGUID)     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case Error_FileNotFound:             WScript.Echo "No dictionary exists for this rule."             Exit Sub         Case 0:             ' OK         Case Else             err.Raise errorCode,, errorDescript     End Select       ' Remove the specified entry.     '   Note: The key is case-sensitive.     On Error Resume Next     vpSet.RemoveValue name     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case Error_FileNotFound:             WScript.Echo "An entry for " & name _              & " was not found in the dictionary."         Case 0:             vpSet.Save     ' OK, save the changes.         Case Else             err.Raise errorCode,, errorDescript     End Select End Sub     ' ' Add an entry (internal string - external string) to the link-translation  ' dictionary of the specified rule. ' Sub AddItemToDictionary(wpRule, internalString, externalString)     Dim vpSets    ' An FPCVendorParametersSets collection     Dim vpSet     ' An FPCVendorParametersSet object     Dim errorCode, errorDescript       Set vpSets = wpRule.VendorParametersSets     On Error Resume Next     Set vpSet = vpSets(LinkTranslatDicGUID)     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case Error_FileNotFound:             ' Create the dictionary if it does not exist.             Set vpSet = vpSets.Add(LinkTranslatDicGUID, False)         Case 0:             ' OK, set was found.         Case Else             err.Raise errorCode,, errorDescript     End Select       ' Add the internal-external entry.     vpSet.Value(internalString) = externalString     vpSets.Save End Sub     ' ' Retrieve the specified Web publishing rule. ' Function GetWebPublishingRule(ruleName)     Dim rules     ' An FPCPolicyRules collection     Dim rule      ' An FPCPolicyRule object     Dim errorCode, errorDescript       Set rules = root.GetContainingArray.ArrayPolicy.PolicyRules     On Error Resume Next     Set rule = rules(ruleName)     Select Case err.Number         Case Error_FileNotFound:             WScript.Echo "The " & ruleName _             & " Web publishing rule was not found."             Wscript.Quit         Case 0:             ' OK         Case Else             err.Raise err.Number,, err.Description     End Select     On Error GoTo 0       If rule.Type <> fpcPolicyRuleWebPublishing Then         WScript.Echo "The " & ruleName & " rule is not a Web publishing rule."         Wscript.Quit     End If       Set GetWebPublishingRule = rule   End Function     ' ' Remove the link-translation dictionary from the vendor parameters sets  ' collection of the specified rule. ' Sub RemoveFromVPSs(vpSets, setName)     Dim errorCode, errorDescript       On Error Resume Next     vpSets.Remove setName     errorCode = err.Number     errorDescript = err.Description     On Error GoTo 0       Select Case errorCode         Case 0:             vpSets.Save                ' OK, save the changes.         Case Error_FileNotFound:             ' Ignore the error if the object was not found             ' or was already removed.         Case Else             err.raise errorCode,,errorDescript     End Select End Sub   Sub Usage()     Dim sUsage       sUsage = "Usage:" & vbCrLf _         & "  LinkTranslation_EditDictionary.vbs Action [RuleName] [IntString]" _              &  " [ExtString]" & vbCrLf _         & vbCrLf _         & "    Action:" & vbCrLf _         & "      ListAll     - List dictionaries for all Web publishing" _                  & " rules." & vbCrLf _         & "      List        - List dictionary for the specified rule." _                  & vbCrLf _         & "      Clear       - Clear all entries from the search-replace" _                  & " dictionary for the specified rule." & vbCrLf _         & "      Add         - Add an entry (internal string - external" _                  & " string) to the dictionary of the specified rule." _                  & vbCrLf _         & "      RemoveEntry - Remove the entry for the specified internal" _                  & " string from the dictionary of the specified rule." _                  & vbCrLf _         & vbCrLf _         & "    RuleName: Specify the Web publishing rule. " & vbCrLf     WScript.Echo sUsage       WScript.Quit End Sub

[ µãÕâÀï¸´ÖÆÍøÖ·£¬ÍƼö¸øÄãQQ/MSNÉϵĺÃÓÑÃÇ! ]
±¾Õ¾ÉùÃ÷£ºÒÔÉÏÄÚÈÝÓÉÍøÓÑ rickyfang Ìṩ£¬Óë54masterÁ¢³¡Î޹أ¡
¡¶ÎÒÊÇÍø¹Ü¡·ÂÛ̳
2007|2008 Microsoft® MVP For ISA
ÏÂÀï°ÍÈ˵ļÒ:http://www.rickyfang.net
΢Èí¹Ù·½ÂÛ̳£ºhttp://forums.microsoft.com/china
E-Mail£º<font color="red">ricky.fang@live.com[color]
[ ¶¥²¿ ]
°¿Ïèsky
¸ß¼¶Íø¹Ü



UID 498801
¾«»ª 1
»ý·Ö 944
Ìû×Ó 220
MST±Ò 8288 µã    
BST±Ò 944 µã    ×¬È¡
ÔĶÁȨÏÞ 110
×¢²á 2007-3-6
״̬ ÀëÏß
  ´ó ÖРС
·¢±íÓÚ 2007-6-21 09:42  [ ×ÊÁÏ ]  [ ²©¿Í ]  [ ¶ÌÏûÏ¢ ]  [ ¼ÓΪºÃÓÑ
ɳ·¢£¬Ïȶ¥ÔÙ¿´¡£¡£¡£¡£

±¾Õ¾ÉùÃ÷£ºÒÔÉÏÄÚÈÝÓÉÍøÓÑ °¿Ïèsky Ìṩ£¬Óë54masterÁ¢³¡Î޹أ¡
[ ¶¥²¿ ]
  
 



µ±Ç°Ê±Çø GMT+8, ÏÖÔÚʱ¼äÊÇ 2008-7-6 09:11

Powered by Discuz! 5.5.0  © 2001-2007 Comsenz Inc.
Processed in 0.459781 second(s), 12 queries , Gzip enabled

Çå³ý Cookies - ¹ØÓÚÎÒÊÇÍø¹Ü - ÁªÏµÎÒÊÇÍø¹Ü - ¹ã¸æ·þÎñ - ³ÏƸ°æÖ÷ - ÎÞͼ°æ - WAP -