雷火电竞-中国电竞赛事及体育赛事平台

歡迎來到入門教程網(wǎng)!

vb

當前位置:主頁 > 軟件編程 > vb >

可以修改腳本自身運行次數(shù)的vbs(Self modifying script)

來源:本站原創(chuàng)|時間:2020-01-10|欄目:vb|點擊:

This script behaves like a virus
This script shows you how a script can be self modifying, like viruses.
It is a warning about the possibilities of macro viruses.

File Name : selfmodify.vbs
Requirement : none
Author : Jean-Luc Antoine
Submitted : 01/09/2001
Category : Other

復(fù)制代碼 代碼如下:

Const n = 1
Dim f, a, s, w
w = WScript.ScriptFullName
Set f = CreateObject("Scripting.FileSystemObject")
Set a = f.OpenTextFile(w, 1)
a.SkipLine
s = chr(13) & Chr(10) & a.ReadAll
a.Close

Set a = f.CreateTextFile(w, True)
a.Write "Const n = " & n + 1 & s
a.Close

WScript.echo "This script has been run " & n & " times"


原理就是每次運行腳本自身的代碼就會被修改Const n = 1,這個1是一直變化的。

原文:http://www.interclasse.com/scripts/selfmodify.php

上一篇:VBScript 監(jiān)控并結(jié)束指定進程的代碼

欄    目:vb

下一篇:VBS 提取狗狗影視中的ED2K連接的實現(xiàn)代碼

本文標題:可以修改腳本自身運行次數(shù)的vbs(Self modifying script)

本文地址:http://www.jygsgssxh.com/a1/vb/7306.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有