我编写了一个脚本,它将向用户邮件 ID 发送一个 OTP(一次性密码)。因此,每当系统向用户发送 OTP 时,我都想启动一个 1 分钟的倒数计时器。但我不确定如何使用 DCL 脚本启动倒数计时器。有什么想法吗?
下面是我用来生成 OTP 的脚本。但是我需要一个倒计时计时器……是否可以在屏幕上显示倒计时?请帮忙 !!
$! RAND - returns a positive random number ("RANDOM") between 0 and
$! __CEIL - 1.
$! sharris-at-sdsdmvax.fb3.noaa.gov
$ RAND:
$
$ IF F$TYPE(__SEED) .EQS. ""
$ THEN
$ ! seed the random number generator, ...
$ __NOW = F$CVTIME()
$ __HOUR = 'F$EXTRACT(11,2,__NOW)'
$ __MINUTE = 'F$EXTRACT(14,2,__NOW)'
$ __SECOND = 'F$EXTRACT(17,2,__NOW)'
$ __TICK = 'F$EXTRACT(20,2,__NOW)'
$
$ __SEED == __TICK + (100 * __SECOND) + (6000 * __MINUTE) + -
(360000 * __HOUR)
$ ! the generator tends to do better with a large, odd seed, ...
$ __SEED == (__SEED .OR. 1)
$ ! clean up, ...
$ DELETEX/SYMBOL __NOW
$ DELETEX/SYMBOL __HOUR
$ DELETEX/SYMBOL __MINUTE
$ DELETEX/SYMBOL __SECOND
$ DELETEX/SYMBOL __TICK
$ ENDIF
$
$ IF F$TYPE(__CEIL) .EQS. "" THEN __CEIL = %X3FFFFFFF
$
$ __SEED == __SEED * 69069 + 1
$ RANDOM == (__SEED.AND.%X3FFFFFFF)/(%X40000000/__CEIL)
$ define sys$output MANAGERS:[EMAL]random.txt
$ sh sym RANDOM
$ deassign sys$output
$ sear MANAGERS:[EMAL]random.txt random /out=MANAGERS:[EMAL]random1.txt
$ open in MANAGERS:[EMAL]random1.txt
$ LOOP4:
$ READ/END_OF_FILE=ENDIT4 IN RANDO
$ GOTO LOOP4
$ ENDIT4:
$ close in
$ RANDOM1 = F$EXTRACT(30,8,RANDO)
$ sh sym RANDOM1
$ mail a.txt smtp%"xx@x.com" /sub="Your Password is ''RANDOM1' "
当我运行上述脚本时,我的 OTP 将如下所示:
Your Password is 1218A57A