wwy810327
发表于 2023-5-23 19:20:04
不能读也。要收费,才是好
llp0420
发表于 2023-5-23 19:37:12
厉害 学习了
白色微風1991
发表于 2023-5-24 07:18:02
感謝樓主分享
laiz3000
发表于 2023-5-25 19:07:59
支持一下
baitang36
发表于 2023-8-11 08:38:00
本帖最后由 baitang36 于 2023-8-11 08:39 编辑
(DEFUN LPGET:TIME-INTNET
(FORMAT / RESULT RGX SERVER XML @JTOY@)
(DEFUN @JTOY@ (J / A B C D)
(setq J (FIX J))
(setq A (FIX (/ (- J 1867216.25) 36524.25)))
(setq B (+ (- (+ J 1 A) (FIX (/ A 4))) 1524))
(setq C (FIX (/ (- B 122.1) 365.25)))
(setq D (FIX (/ (- B (FIX (* 365.25 C))) 30.6001)))
(FIX (- C
(if (< 2
(FIX (if (< D 14)
(PROGN (1- D))
(PROGN (- D 13))
) ;_ if
) ;_ FIX
) ;_ <
(PROGN 4716)
(PROGN 4715)
) ;_ if
) ;_ -
) ;_ FIX
) ;_ DEFUN
(setq SERVER "http://time.nist.gov:13")
(setq RESULT
(VL-CATCH-ALL-APPLY
'(lambda (/ STR)
(setq XML (vlax-create-object
"MSXML2.XMLHTTP.3.0"
) ;_ vlax-create-object
) ;_ setq
(setq
RGX (vlax-create-object "VBScript.RegExp")
) ;_ setq
(vlax-invoke-method
XML 'OPEN "POST" SERVER :vlax-false) ;_ vlax-invoke-method
(vlax-invoke-method XML 'SEND)
(if (setq STR
(vlax-get-property XML 'RESPONSETEXT)
) ;_ setq
(PROGN
(vlax-put-property RGX 'GLOBAL acTrue)
(vlax-put-property RGX 'IGNORECASE acTrue)
(vlax-put-property RGX 'MULTILINE acTrue)
(setq STR
(STRCAT
" "
(ITOA (@JTOY@
(+ (ATOI (SUBSTR STR 2 5))
2400000.5
) ;_ +
) ;_ @JTOY@
) ;_ ITOA
(SUBSTR STR 7)
) ;_ STRCAT
) ;_ setq
(MAPCAR
'(lambda (A B)
(vlax-put-property RGX 'PATTERN A)
(setq FORMAT (vlax-invoke
RGX
'REPLACE
FORMAT
B
) ;_ vlax-invoke
) ;_ setq
) ;_ lambda
'("YYYY" "YY" "MO" "DD" "HH" "MM" "SS")
'("$1" "$2" "$3" "$4" "$5" "$6" "$7")
) ;_ MAPCAR
(vlax-put-property
RGX
'PATTERN
(STRCAT
"(?:[^\\d]+)([\\d]+)(?:[^\\d]+)([\\d]+)"
"(?:[^\\d]+)([\\d]+)(?:[^\\d]+)([\\d]+)"
"(?:[^\\d]+)([\\d]+)(?:[^\\d]+)([\\d]+)"
"(?:[^\\d]+)([\\d]+)(?:.+)\\n"
) ;_ STRCAT
) ;_ vlax-put-property
(vlax-invoke-method
RGX
'REPLACE
STR
FORMAT
) ;_ vlax-invoke-method
) ;_ PROGN
) ;_ if
) ;_ lambda
) ;_ VL-CATCH-ALL-APPLY
) ;_ setq
(if XML
(PROGN (vlax-release-object XML))
) ;_ if
(if RGX
(PROGN (vlax-release-object RGX))
) ;_ if
(if (NOT (VL-CATCH-ALL-ERROR-P RESULT))
(PROGN RESULT)
) ;_ if
)
(setq GET-TIME-NET (LPGET:TIME-INTNET "YYYYMODD.HHMMSS"))
baitang36
发表于 2023-11-13 09:53:45
tryhi 发表于 2023-5-18 11:42
[*](CDAR (D_GETREMOTEFILEHEADERS
[*] "https://www.baidu.com"
[*] (LIST "Da ...
确实是慢8个小时。
但用来判断程序是否过期,误差8个小时不算差,给人家多算一两天就行。
magicheno
发表于 2024-2-6 02:29:30
感谢大佬分享
laorenhao999
发表于 2024-7-24 19:49:26
这个确实获取时间快了很多