利用批處理BAT生成隨機(jī)數(shù)實(shí)現(xiàn)隨機(jī)網(wǎng)站內(nèi)容
更新時間:2013年05月06日 23:07:21 作者:
今天想用批處理(BAT)的方式隨機(jī)打開網(wǎng)站某頁面,基目的是刷網(wǎng)站的PV
%RANDOM% 返回 0 到 32767 之間的任意十進(jìn)制數(shù)字。比如說想生成0-100的隨機(jī)數(shù)就是對101取余數(shù)就可以了。格式是:set num=%RANDOM%%%100
下面是我的實(shí)例代碼:
@echo off
set s=10000
set g=10
cls
set count=0
:loop
set /a num=%random%%%%s%+1
if not defined num%num% (
set num%num%=%num%
set /a count1
call explorer.exe http://www.dbjr.com.cn/article/%%num%%.html
)
if %count% lss %g% goto loop
下面是我的實(shí)例代碼:
復(fù)制代碼 代碼如下:
@echo off
set s=10000
set g=10
cls
set count=0
:loop
set /a num=%random%%%%s%+1
if not defined num%num% (
set num%num%=%num%
set /a count1
call explorer.exe http://www.dbjr.com.cn/article/%%num%%.html
)
if %count% lss %g% goto loop
相關(guān)文章
用asp.net實(shí)現(xiàn) 取頁面中的所有鏈接
用asp.net實(shí)現(xiàn) 取頁面中的所有鏈接...2007-05-05dos/bat中獲取用戶輸入內(nèi)容的代碼(保存到文件中)
這篇文章主要介紹了dos/bat中獲取用戶輸入內(nèi)容的代碼,并且可以保存到文件中,需要的朋友可以參考下2022-11-11