当前位置: 首页 > news >正文

wordpress 后台禁用百度seo关键词点击软件

wordpress 后台禁用,百度seo关键词点击软件,wordpress内容隐藏,青岛谷歌seo文章目录 概述执行脚本语法转义字符文本弹框msgbx定义变量dim(普通类型)定义接收对象set字符拼接&用户自定义输入框inputbox以及输入判断ifelse数组(参数表最大索引,非数组容量)有容量无元素基于元素确定容量 循环…

文章目录

    • 概述
    • 执行脚本
    • 语法
      • 转义字符
      • 文本弹框msgbx
      • 定义变量dim(普通类型)
      • 定义接收对象set
      • 字符拼接&
      • 用户自定义输入框inputbox以及输入判断ifelse
      • 数组(参数表最大索引,非数组容量)
        • 有容量无元素
        • 基于元素确定容量
      • 循环、迭代
    • 内置函数
    • 自定义函数
      • print - 控制台打印
      • getArraySize - 获取数组长度
      • execCmd - 执行CMD命令
      • readFileContent - 读取文件内容
      • getEnvKeyValue - 获取某个环境变量值
      • setEnvKeyValue - 新建或修改某个环境变量值
    • Windows常用内置对象
      • 文件对象:Scripting.FileSystemObject
      • 系统环境变量对象:USER

概述

VBS(Visual Basic Script Editor): 基于Visual Basic开发的脚本语言文件

注释(仅有单行注释符号,无多行): 英文单引号’,

判断: 值是否等于无需像其他语言一样输入双等于号直接单等于号即可,不等于则使用<>进行替代

系统对象使用的文档(可直接参考微软的VBA文档):https://learn.microsoft.com/en-us/office/vba/api/overview/

语法细节:
  1. 关键字大小写不敏感,函数名大小写敏感。
 定义Function函数时如果没有设置返回值,则内部自动转成sub,而调用sub

执行脚本

//方式1
直接双击脚本//方式2 ==  CMD命令窗口
wscript //e:vbscript vbs脚本文件//方式3 == CMS命令行窗口
C:\Windows\System32\cscript.exe  vbs脚本文件
适合交互
适合批处理
执行程序
wscript:窗口应用程序,不创建控制台窗口,输出不会在命令行中显示
cscript:控制台应用程序,运行时会有一个命令行窗口,输出被发送到这个窗口

语法

转义字符

'换行符 vbCrLfPublic Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionprint "fdsfsd"&"fsdfsdf"print "=========="print "fdsfsd"&vbCrLf&"fsdfsdf"

在这里插入图片描述

文本弹框msgbx

'类似前端的alert玩意
msgbox "弹框内容"

在这里插入图片描述

定义变量dim(普通类型)

dim name
name="lrc"msgbox name

在这里插入图片描述

定义接收对象set

Set oFS = CreateObject("Scripting.FileSystemObject")

字符拼接&

dim name,sport
name="lrc"
sport="swimming"msgbox name&"喜欢的运动是:"&sport

在这里插入图片描述

用户自定义输入框inputbox以及输入判断ifelse

格式: if then elseif then else then end if

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functiondim a,b,c,result
result = 0a = inputbox("请输入一个数字")
print ab = inputbox("请输入操作符")
print bc = inputbox("请输入另一个数组")
print cif b = "+" thenresult = CDbl(a) + CDbl(c)
elseif b = "-" thenresult = a - c
elseif b = "*" thenresult = a * c
elseif b = "/" thenresult = a / c
end ifprint a&b&c&"="&result
msgbox result

在这里插入图片描述

数组(参数表最大索引,非数组容量)

有容量无元素
Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Function'定义容量为5个元素的数组,里面的括号表示数组的最大索引
dim nums(4)nums(0)=10
nums(3)=20print nums(0)
print nums(3)

在这里插入图片描述

基于元素确定容量
Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionprint "=========="dim nums(2)
nums(0) = 0
nums(1) = 1
nums(2) = 2
for i = 0 to 2print nums(i)
nextprint "=========="dim nums2
nums2 = array(0,1,2)
for i = 0 to 2print nums2(i)
next

在这里插入图片描述

循环、迭代

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionpublic function getArraySize(nums)getArraySize = UBound(nums) - LBound(nums) + 1
end functiondim nums(5)
nums(0) = 1
nums(1) = 11
nums(2) = 111
nums(3) = 1111
nums(4) = 11111
nums(5) = 111111for i = 0 to getArraySize(nums)-1print i
Nextprint ""
print ""dim index
index =0
do while trueif index = getArraySize(nums) thenExit doend ifprint "nums["&index&"]: "&nums(index)index = index + 1
loopprint ""
print ""index =0
doprint "nums["&index&"]: "&nums(index)index = index + 1
loop until index = getArraySize(nums)print ""
print ""for each numElem in numsprint numElem
next

在这里插入图片描述

内置函数

//将入参转成小数类型Double出参结果
CDbl//将入参转成整数类型Integer出参结果
CInt//将入参转成长整数类型Long出参结果
CLNG//将入参转成长布尔类型Bool出参结果 ==  0=>false 其他数字t=>true,转不出来数字报错
CBool//将入参转成字节类型Byte出参结果
CByte//用于将表达式转换为货币型数据(Currency)
CCur//用于将有效的日期表达式转换为日期型数据
CDate//将表达式转换为单精度浮点型数据(Single) == java的Float
CSng//返回字符串首字母的ANSI字符代码(ASCII值) == 数字
Asc//将指定的ANSI字符代码转换为相应的字符 == 字符串
Chr//将指定的数字转换为十六进制值
Hex//将指定的数字转换为八进制值
Oct//字符串2在字符串1的索引位置,索引从1开始,不是从0
InStr//字符串全部变成大写
ucase
Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functiondim a,b,c,d,e,f,g'转成浮点数,入参非数字直接报错
a = CDbl("123")
print aa = CDbl("123.5")
print a'非数字直接报错
b = CBool(2)
print b
b = CBool(0)
print b
b = CBool(0.6)
print bprint ""'8字节的数字
c = CByte("30")
print cd = Asc("a")
print de = Chr(97)
print ef = Hex(20)
print fg = Oct(20)
print g

在这里插入图片描述

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functiondim h, i
h = "fsdfds123f"
i = "123"
print InStr(h, i)

在这里插入图片描述

自定义函数

tip: 有无返回值,建议都使用 function 即可,毕竟相较于其他语言,并没有sub这玩意

函数
function:期望函数调用有返回值
sub:期望函数调用无返回值

print - 控制台打印

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionprint "fsfsdf"

在这里插入图片描述

getArraySize - 获取数组长度

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionpublic function getArraySize(nums)getArraySize = UBound(nums) - LBound(nums) + 1
end functiondim nums(5)arraySize = getArraySize(nums)
print arraySize

在这里插入图片描述

execCmd - 执行CMD命令

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionpublic function getArraySize(nums)getArraySize = UBound(nums) - LBound(nums) + 1
end function'' 创建WScript.Shell对象
'Set objShell = CreateObject("WScript.Shell")
'
'' 执行cmd命令,这里以"ipconfig /all"为例
'Set objExecObject = objShell.Exec("cmd /c ipconfig /all")
'
'' 读取命令执行的结果
'Do While Not objExecObject.StdOut.AtEndOfStream
'    strText = objExecObject.StdOut.ReadAll()
''    WScript.Echo strText
'    print "================="
'    print "================="
'    print strText
'Looppublic Function execCmd(cmd)dim result
' 创建WScript.Shell对象Set objShell = CreateObject("WScript.Shell")' 执行cmd命令,这里以"ipconfig /all"为例Set objExecObject = objShell.Exec("cmd /c "&cmd)' 读取命令执行的结果Do While Not objExecObject.StdOut.AtEndOfStreamresult = objExecObject.StdOut.ReadAll()LoopexecCmd = resultend Functiondim pwdResult,execComandStr
execComandStr = "pwd"
pwdResult = execCmd(execComandStr)print pwdResult

在这里插入图片描述

readFileContent - 读取文件内容

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionpublic function getArraySize(nums)getArraySize = UBound(nums) - LBound(nums) + 1
end functionpublic Function execCmd(cmd)dim result' 创建WScript.Shell对象Set objShell = CreateObject("WScript.Shell")' 执行cmd命令,这里以"ipconfig /all"为例Set objExecObject = objShell.Exec("cmd /c "&cmd)' 读取命令执行的结果Do While Not objExecObject.StdOut.AtEndOfStreamresult = objExecObject.StdOut.ReadAll()LoopexecCmd = resultend Functionpublic Function readFileContent(filePath)Set oFS = CreateObject("Scripting.FileSystemObject")dim result,currentRowContentresult = ""'文件不存在,直接退出If Not oFS.FileExists(filePath) Thenprint "[warning]file no exit: "&filePathreadFileContent = resultexit FunctionEnd If'文件存在Set oFile = oFS.OpenTextFile(filePath, 1, 0)do until oFile.AtEndOfStreamcurrentRowContent = oFile.ReadLineresult = result & currentRowContent & vbLfloopreadFileContent = resultend Functiondim resultresult = readFileContent("D:\workspace\personal\selenium-test\src\main\java\work\linruchang\vbsFile\1.txt")
print resultresult = readFileContent("D:\workspace\personal\selenium-test\src\main\java\work\linruchang\vbsFile\2.txt")
print result

在这里插入图片描述

在这里插入图片描述

getEnvKeyValue - 获取某个环境变量值

'打印日志
Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Function'获取某个环境变量值
public Function getEnvKeyValue(keyName)Set oShell = CreateObject("WScript.Shell")Set oEnv = oShell.Environment("USER")getEnvKeyValue = oEnv(keyName)
end Functiondim result
result = getEnvKeyValue("OneDrive")
print result

在这里插入图片描述

在这里插入图片描述

setEnvKeyValue - 新建或修改某个环境变量值

'修改新建某个环境变量值
public Function setEnvKeyValue(keyName, keyValue)Set oShell = CreateObject("WScript.Shell")Set oEnv = oShell.Environment("USER")oEnv(keyName) = keyValue
end FunctionsetEnvKeyValue "OneDrive2", "C:\Users\Administrator\OneDrive"

在这里插入图片描述

Windows常用内置对象

系统对象使用的文档(可直接参考微软的VBA文档):https://learn.microsoft.com/en-us/office/vba/api/overview/

文件对象:Scripting.FileSystemObject

Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Functionpublic function getArraySize(nums)getArraySize = UBound(nums) - LBound(nums) + 1
end functionpublic Function execCmd(cmd)dim result' 创建WScript.Shell对象Set objShell = CreateObject("WScript.Shell")' 执行cmd命令,这里以"ipconfig /all"为例Set objExecObject = objShell.Exec("cmd /c "&cmd)' 读取命令执行的结果Do While Not objExecObject.StdOut.AtEndOfStreamresult = objExecObject.StdOut.ReadAll()LoopexecCmd = resultend FunctionSet oShell = CreateObject("WScript.Shell")Set oFS = CreateObject("Scripting.FileSystemObject")'读取文本文件,并打印出来到控制台
dim file,fileContent,currentRowContent
file = "D:\workspace\personal\selenium-test\src\main\java\work\linruchang\vbsFile\1.txt"
Set oFile = oFS.OpenTextFile(file, 1, 0)
do until oFile.AtEndOfStreamcurrentRowContent = oFile.ReadLinefileContent = fileContent & currentRowContent & vbLf
loop
oFile.Closeprint fileContent

在这里插入图片描述

在这里插入图片描述

系统环境变量对象:USER


'打印日志
Public Function print(message)Set stdout=CreateObject("Scripting.FileSystemObject").GetStandardStream(1)stdout.WriteLine message
End Function'获取某个环境变量值
public Function getEnvKeyValue(keyName)Set oShell = CreateObject("WScript.Shell")Set oEnv = oShell.Environment("USER")getEnvKeyValue = oEnv(keyName)
end Functiondim result
result = getEnvKeyValue("OneDrive")
print result'修改新建某个环境变量值
public Function setEnvKeyValue(keyName, keyValue)Set oShell = CreateObject("WScript.Shell")Set oEnv = oShell.Environment("USER")oEnv(keyName) = keyValue
end FunctionsetEnvKeyValue "OneDrive2", "C:\Users\Administrator\OneDrive2"print(getenvkeyvalue("OneDrive2"))

在这里插入图片描述

在这里插入图片描述

http://www.ds6.com.cn/news/117142.html

相关文章:

  • dedecms学校网站模板免费下载怎么做网络广告
  • 莒县做网站和微信网络营销
  • 公司网站集资网站开发人员犯法么免费网络推广网址
  • 怎样解析网站域名网络营销的背景和意义
  • 网站要什么什么叫口碑营销
  • 网站模仿侵权搜索排名查询
  • 网站建设服务哪家好百度搜索官网
  • 腾讯云域名续费太原seo排名优化公司
  • 网站建设考试卷a卷培训师资格证怎么考
  • wordpress博文模板长沙网站托管优化
  • 百度网站抓取时间查询广州做seo的公司
  • 网站设计时多页面切换时什么控件河源市seo点击排名软件价格
  • 蓝色科技网站建设专业seo公司
  • 免费crm网站下载的软件自媒体软文发布平台
  • wordpress mega郑州网站推广优化
  • wordpress怎么弄廊坊网站建设优化
  • 哪些做靠谱兼职网站有哪些西安seo网站建设
  • 一流专业建设标准朝阳seo排名
  • 服装品牌网站建设广州百度关键词推广
  • 怎样做网站测评广州seo公司排行
  • 苏州吴中区做网站公司常用网站推广方法及资源
  • 如何制作网站视频教程免费网站建设哪家好
  • 网站做302重定向360网站收录提交
  • 阿里云企业网站怎么收费seo是指什么职位
  • 太原广告传媒有限公司淄博seo
  • 做网站需要注意什么问题宁波做seo推广企业
  • 网站建设与网页设计专业seo网络推广哪家专业
  • 网站运营要会什么技术企业门户网站
  • 做网站需要用什么开发软件系统优化大师
  • 小学学校网站建设方案汕头seo推广优化