教学文库网 - 权威文档分享云平台
您的当前位置:首页 > 精品文档 > 政务民生 >

按键精灵认证总结(3)

来源:网络收集 时间:2026-07-17
导读: Do Input增加 = InputBox(\退出:Q 主页:H\格式:姓名|年龄|身高\例如:李雷|18|1.52\增加·请输入要增加的一条数据\ If Input增加 = \增加 = \ ElseIf Input增加 = \增加 = \ ElseIf UBound(Split(Input增加, \

Do

Input增加 = InputBox(\退出:Q 主页:H\格式:姓名|年龄|身高\例如:李雷|18|1.52\增加·请输入要增加的一条数据\

If Input增加 = \增加 = \ ElseIf Input增加 = \增加 = \ ElseIf UBound(Split(Input增加, \ 增加 数据库路径, Input增加 End If loop

ElseIf InputHome = \ Else

InputHome = InputBox(\退出:Q 主页:H\查询:1 2 删除:3 增加:4\主页·请输入对应字符进行相关操作\ End If Loop EndScript

Function 查询(文本路径, 编号) Dim fso, myfile, i, flag, tempp flag = 1

Set fso = CreateObject(\ If fso.FileExists(文本路径) Then

Set myfile = fso.openTextFile(文本路径, 1, false) Else

flag = 0 End If

For i = 1 To 编号 - 1

If Not myfile.AtEndOfLine Then myfile.SkipLine tempp = myfile.Line End If Next

If flag = 1 Then

If Not myfile.AtEndOfLine Then 查询 = myfile.ReadLine Else

查询 = \编号不存在!\ End If

myfile.close Else

查询 = \文件不存在!\ End If

Set fso = Nothing End Function

Function 搜索(文本路径, 关键字)

搜索: Dim ForReading, ForWriting

ForReading = 1 : ForWriting = 2 : 搜索 = \ Dim objFSO, objFile, strLine, strNewFile

Set objFSO = CreateObject(\ Set objFile = objFSO.OpenTextFile(文本路径, ForReading) Do Until objFile.AtEndOfStream strLine = objFile.Readline

If Instr(1, strLine, 关键字) > 0 Then 搜索 = strLine & \搜索 TracePrint \搜索=\搜索

strNewFile = strNewFile & strLine & vbcrlf Loop

objFile.Close

Set objFile = objFSO.OpenTextFile(文本路径, ForWriting) objFile.Write strNewFile objFile.Close

Set objFSO = Nothing End Function

Sub 删除(文本路径, 编号)

Dim ForReading ,ForWriting ForReading = 1 ForWriting = 2

Dim objFSO,objFile,strLine,strNewFile

Set objFSO = CreateObject(\ Set objFile = objFSO.OpenTextFile(文本路径,ForReading) Do Until objFile.AtEndOfStream

strLine = objFile.Readline

If CInt(编号) = objFile.Line - 1 or CInt(编号) = 0 Then strNewFile = strNewFile Else

strNewFile = strNewFile & strLine & vbcrlf End If Loop

objFile.Close

Set objFile = objFSO.OpenTextFile(文本路径,ForWriting) objFile.Write strNewFile objFile.Close

Set objFSO = Nothing End Sub

Sub 增加(文本路径, 文本内容) Dim ForReading ,ForWriting ForReading = 1 : ForWriting = 2

Dim objFSO, objFile, strLine, strNewFile

Set objFSO = CreateObject(\ Set objFile = objFSO.OpenTextFile(文本路径, ForReading)

Do Until objFile.AtEndOfStream strLine = objFile.Readline

strNewFile = strNewFile & strLine & vbcrlf Loop

TracePrint objFile.Line

strNewFile = strNewFile & objFile.Line & \文本内容 & vbcrlf objFile.Close

Set objFile = objFSO.OpenTextFile(文本路径, ForWriting) objFile.Write strNewFile objFile.Close

Set objFSO = Nothing End Sub EndScript

'六、3、动态监控文本内容,当文本内容增加时(文本内容不会减少)自动输出增加的内容到所有标题包含\接收\关键字的文本(批量消息发送器),请写出代码

'六、4、写一个子程序,可以改变窗口内的某个子窗口的大小为特定值,子窗口大小随顶层窗口变化而比例变化(提示:改变顶层窗口,判断子窗口大小),请写出代码

'六、5、利用函数输出杨辉三角,需要的参数为杨辉三角的行数,请写出代码 '六、杨辉三角百度说明:http://baike.http://www.wodefanwen.com//view/7804.htm

'五:1、写出三种计算颜色相似度的算法,函数返回值为相似度.请写出代码 MsgBox 颜色相似度1(\颜色相似度1\MsgBox 颜色相似度2(\颜色相似度2\MsgBox 颜色相似度3(\颜色相似度3\Function 颜色相似度1(当前颜色, 对比颜色)

Call Plugin.Color.ColorToRGB(当前颜色, R1, G1, B1) Call Plugin.Color.ColorToRGB(对比颜色, R2, G2, B2)

颜色相似度1 = 1 - round((abs((R1 - R2) / 255) + abs((G1 - G2) / 255) + abs((B1 - B2) / 255)) / 3, 3) End Function

Function 颜色相似度2(当前颜色, 对比颜色)

Call Plugin.Color.ColorToRGB(当前颜色, R1, G1, B1) Call Plugin.Color.ColorToRGB(对比颜色, R2, G2, B2)

颜色相似度2 = 1 - round((abs(R1 - R2) + abs(G1 - G2) + abs(B1 - B2)) / 255 / 3, 3) End Function

Function 颜色相似度3(当前颜色, 对比颜色)

Call Plugin.Color.ColorToRGB(当前颜色, R1, G1, B1) Call Plugin.Color.ColorToRGB(对比颜色, R2, G2, B2)

颜色相似度3 = 1 - round((abs(R1 / 255 - R2 / 255) + abs(G1 / 255 - G2 / 255) + abs(B1 / 255 - B2 / 255)) / 3, 3) End Function

'五:2、(前台)区域范围为(100,150)到(200,300)内的所有点是否均为\是则弹出对话框\没有其他颜色\否则弹出第一个点的颜色值并退出程序. 请写出代码 Dim x, y, RtColor

x = 100 : y = 150 Do While y < 301

For x = 100 To 200

RtColor = Plugin.Color.GetPixelColor(x, y, 0) If RtColor <> \ Next : y = y + 1 Loop

If RtColor <> \

MessageBox X & \坐标点颜色为:\Else

MessageBox \没有其他颜色\End If EndScript

'五:3、写一个函数,要求:返回一个数值范围内所有偶数之和。参数1、参数2:整数型,数字 提示:For循环与VBS命令函数应用。 TracePrint 求偶数之和(1, 61) TracePrint 求偶数之和(3, 19) TracePrint 求偶数之和(0, 83) TracePrint 求偶数之和(2, 1) EndScript

Function 求偶数之和(参数1, 参数2) Dim 差, i 求偶数之和 = 0 : 差 = Abs(参数1 - 参数2) If 差 mod 2 = 1 Then : 差 = 差 - 1 : End If For i = 0 To 差 / 2 - 1 求偶数之和 = 求偶数之和 + 差 - i * 2 'TracePrint \ 求偶数之和=\求偶数之和 & \ 差=\差 - i * 2 Next End Function

'五:4、遍历字符串\取出所有小写字母及数字,并按照与原来相反的顺序拼接成新的字符串, …… 此处隐藏:1725字,全部文档内容请下载后查看。喜欢就下载吧 ……

按键精灵认证总结(3).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.jiaowen.net/wendang/447804.html(转载请注明文章来源)
Copyright © 2020-2025 教文网 版权所有
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:78024566 邮箱:78024566@qq.com
苏ICP备19068818号-2
Top
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)