ProviderType 属性 (ActiveX) 
指定加密提供程序类型。(已过时) 支持的平台:仅限 Windows 属性值只读:不 类型:长 加密提供程序类型。有关加密提供程序的详细信息,请访问 MSDN (https://msdn.microsoft.com)。 言论注意:从基于 AutoCAD-2016 的产品开始,已停止使用密码保护图形文件的功能。 
 
例子VBA: Sub Example_ProviderType()
    ' This example encrypts and saves a file.
    Dim sp As AcadSecurityParams
    Set sp = GetInterfaceObject("AutoCAD.SecurityParams.20")
    
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") 'AutoCAD converts all passwords to uppercase before applying them
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1
    
    ThisDrawing.SaveAs "C:\MyDrawing.dwg", , sp
End Sub
 
  可视化 LISP: (vl-load-com)
(defun c:Example_ProviderType()
    ;; This example encrypts and saves a drawing file.
    (setq acadObj (vlax-get-acad-object))
    (setq sp (vlax-create-object "AutoCAD.SecurityParams.20"))
    (vla-put-Visible acadObj :vlax-true)
    (vla-put-Action sp ACADSECURITYPARAMS_ENCRYPT_DATA)
    (vla-put-Algorithm sp ACADSECURITYPARAMS_ALGID_RC4)
    (vla-put-KeyLength sp 40)
    (vla-put-Password sp (strcase "mypassword"))
    (vla-put-ProviderName sp "Microsoft Base Cryptographic Provider v1.0")
    (vla-put-ProviderType sp 1)
    (setq doc (vla-get-ActiveDocument acadObj))
    (vla-SaveAs doc "C:\\MyDrawing.dwg" acNative sp)
    (vlax-release-object sp)
)
 
 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 23:28
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.