 
- 帖子
- 431
- 积分
- 1577
- 技术
- 11
- 捐助
- 0
- 注册时间
- 2013-1-11
|
[问题求助] VBS随机读取单数行,并让读到的单数行加1,输出这2行到剪贴板
本帖最后由 我来了 于 2014-4-15 22:14 编辑
I have not failed. I’ve just found 10,000 ways that won’t work. – Thomas Edison
我并没有失败。我只是找到了1万个不成功的方法。——托马斯·爱迪生
Failure defeats losers, failure inspires winners. – Robert T. Kiyosaki
失败可以打击输家,也可以启发赢家。——罗伯特·T·清崎
Some people dream of great accomplishments, while others stay awake and do them. – Anonymous
有人梦想伟大的成就,但有人一直清清楚楚地在做。——无名氏
I cannot give you the formula for success, but I can give you the formula for failure, which is: Try to please everybody. - Herbert B. Swope
我不能给你成功的计算公式,但我可以给你失败的计算公式,那就是:试着取悦每个人。——赫伯特·B·斯沃普
If you have always done it that way, it is probably wrong. - Charles Kettering
如果你一直用这种方法做事,那它很可能是错误的。——查尔斯·凯特宁
Being different is one of the most beautiful things on earth. - Anonymous
与众不同是世界上最美好的事情之一。——无名氏
Creativity is intelligence having fun. – Albert Einsten
创造力是智力的乐趣。——艾尔伯特·爱因斯坦
randomize
set fso = CreateObject("Scripting.Filesystemobject")
set a = CreateObject("Scripting.Dictionary")
set file = fso.OpenTextFile("D:\OperaZ_Y\英语谚语.txt")
do until file.AtendofStream
m = m + 1
a.add m,file.readline
loop
file.close
h=int(rnd * m + 1)
if h = m then h = m - 1
if h = 1 then h = 2
for i = h-1 to h
str = str & a(i) & vbCrLf
Next
'msgbox str
CreateObject("WScript.Shell").Run "G:\PowerPro_4.9n7\配置文件夹\nircmd.exe clipboard set "&chr(34)&str&chr(34)
WScript.Sleep 1000
Set WshShell= WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "^v"
WshShell.SendKeys "^{ENTER}"
配对! 我也不知如何表达,叠加一起大家应该懂了吧
就是一次读取 2行,并且这两行表达的的一个英语谚语~~
(必须:
1,随机读取到的是单数行,
2,并外加它的下一行到剪贴板)
永远是形如:AAA+BBB,或CCC+DDD,
而不是BBB+CCC,就是文搭义(所在行跟所配的英文是对搭的~~)
AAA
BBB
CCC
DDD
|
|