CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

PutRemoteFile Method (ActiveX)

2023-1-4 04:53| 发布者: admin| 查看: 521| 评论: 0|来自: AutoCAD

摘要: 将文件上载到 AutoCAD 已知的 URL 指定的远程 FTP 位置。

将文件上载到 AutoCAD 已知的 URL 指定的远程 FTP 位置。

支持的平台:仅窗口

签名

工 务 局:

object.PutRemoteFile URL, LocalFile
对象

类型:实用工具

此方法适用的对象。

网址

访问:仅输入

类型:字符串

要将文件上载到的 URL 位置。

本地文件

访问:仅输入

类型:字符串

要上传的文件。

返回值(RetVal)

无返回值。

言论

该方法旨在补充该方法。GetRemoteFile

访问安全 URL 时,会出现一个对话框,提示用户输入必要的密码信息。如果用户未在其浏览器中禁止显示此活动,则会显示消息框。

例子

工 务 局:

Sub Example_PutRemoteFile()
    ' This example transfers a local file to a remote URL.  Since this example
    ' relies on both a remote server name and a local file, you will have to
    ' modify both the DestURL and LocalFile variables below to run this example.
    
    Dim DestURL As String, LocalFile As String
    
    ' Define source and destination
    DestURL = "ftp://www.myserver.com/autocadfiles/"
    LocalFile = "c:\program files\autocad\sample\city map.dwg"
    
    ' Transfer local file to remote location
    ThisDrawing.Utility.PutRemoteFile DestURL, LocalFile
    
    MsgBox LocalFile & " was just transfered to: " & DestURL
End Sub

Visual LISP:

(vl-load-com)
(defun c:Example_PutRemoteFile()
    ;; This example transfers a local file to a remote URL.  Since this example
    ;; relies on both a remote server name and a local file, you will have to
    ;; modify both the DestURL and LocalFile variables below to run this example.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    
    ;; Define source and destination
    (setq DestURL "ftp://www.myserver.com/autocadfiles/")
    (setq LocalFile "C:\\autocad\\samples\\city map.dwg")
    
    ;; Transfer local file to remote location
    (vla-PutRemoteFile (vla-get-Utility doc) DestURL LocalFile)
    
    (alert (strcat LocalFile " was just transfered to: " DestURL))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-12 11:25

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部