Board logo

标题: [文本处理] 批处理怎样把字符串随机排列并列出所有的可能性? [打印本页]

作者: m4233871    时间: 2012-8-8 14:20     标题: 批处理怎样把字符串随机排列并列出所有的可能性?

批处理 1:一串字符如:sfgh23       2:网址如:www.sfgh23.com   sfgh23.com
1:输入字符如:sfgh23 可以让字母随机大小写 并生成txt文档列出所有的可能性 如sfGh23  SfGh23 sFgh23 等等

2:输入网址如:www.sfgh23.com       sfgh23.com 可以让字母和.随机大小写 并生成txt文档列出所有的可能性 如 wWw.SfGH23。com      sfgH23。Com 等等


谢谢帮忙,小弟感激不尽
作者: m4233871    时间: 2012-8-8 15:31

来个人帮下忙啊~
作者: m4233871    时间: 2012-8-8 16:55

跪求帮忙:'(:'(
作者: m4233871    时间: 2012-8-8 20:40

再次跪求帮忙
作者: poter    时间: 2012-8-11 14:17

兄弟求随机字符很好做,但想列举所有的可能就很困难了。用vbs给做了一个
  1. option explicit
  2. Randomize
  3. dim str1, str2, count1, count2, count3, class1, class2, case1
  4. str1 = inputbox("输入字符")
  5. count2 = inputbox("输入次数") + 0
  6. set class1 = createobject("scripting.filesystemobject")
  7. set class2 = class1.createtextfile("123.txt", 2)
  8. do
  9. str2 = ""
  10. for count1 = 1 to len(str1) step 1
  11. str2 = str2 & func1(ucase(mid(str1, count1, 1)) & mid(str1, count1, 1))
  12. next
  13. count3 = count3 + 1
  14. class2.writeline str2
  15. loop until count3 = count2
  16. function func1(aa)
  17. func1 = mid(aa, rnd * 10 mod 2 + 1, 1)
  18. end function
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2