 - (defun d_getremotefileheaders(/ objhttp remotefilename result)
- (setq remotefilename "https://www.baidu.com")
- (if (setq objhttp (vlax-create-object "WinHTTP.WinHTTPRequest.5.1"))
- (progn
- (setq result
- (vl-catch-all-apply
- '(lambda ()
- (vlax-invoke-method objhttp "Open" "HEAD" remotefilename :vlax-false)
- (vlax-invoke objhttp "Send")
- (if
- (= (vlax-get-property objhttp "Status")200)
- (mapcar
- '(lambda (H / R)
- (setq R (vl-catch-all-apply 'vlax-invoke-method (list objhttp "GetResponseHeader" H )))
- (cons h
- (if(not (vl-catch-all-error-p R))
- R
- ) ;_ if
- ) ;_ CONS
- ) ;_ lambda
- (LIST "Date")
- ) ;_ PROGN
- ) ;_ if
- ) ;_ lambda
- ) ;_ VL-CATCH-ALL-APPLY
- ) ;_ setq
- (vlax-release-object objhttp)
- (if (and result (not (vl-catch-all-error-p result)))
- result
- ) ;_ if
- ) ;_ PROGN
- ) ;_ if
- )
-
- (d_getremotefileheaders)
- 直接这样也行吧、反正有返回数据就是联网了
|