![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-11 20:32 |
共 47,811 主题排行 / 349,897 发帖 / 今日 0 篇 / 48,256 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » [求助]替换截取出错 |
| 可打印版本 727 / 4 |
| 第1楼 w1314ich | 发表于 2009-05-07 13:23 |
| 中级用户 发帖 119 积分 234 | |
|
[求助]替换截取出错 参照w1314ich求助的帖子
http://www.cn-dos.net/forum/viewthread.php?tid=47022 使用批处理(批处理是yishanju大哥写的,很棒): @echo off 对下面的代码做处理 </font><font color="#0000ff"><fontcolor="#000000">BOOK1<br/>http://www.book-down.cn/工程理论免费电子书1.exe<br/><br/><font color="#0000ff">BOOK2<br/>http://www.book-down.cn/工程理论免费电子书2.exe</font><br/></font></font></font></div> 结果是: </font><font color="#0000ff"><font color="#000000">BOOK1<br/> 错误是批处理把两个下载地址并在一起处理了,请问该如何修改使批处理对每个下载地址单独处理,而且资源名称部分也就是oncontextmenu="ThunderNetwork_SetHref(this)">和</a>中间的部分我只想替换成文件名,即工程理论免费电子书1.exe,工程理论免费电子书2.exe [ Last edited by w1314ich on 2009-5-7 at 13:34 ] |
|
| 第2楼 yishanju | 发表于 2009-05-07 15:11 |
| 银牌会员 发帖 1,357 积分 1,488 | |
|
迷糊,看到脑袋晕死
|
|
| 第3楼 yishanju | 发表于 2009-05-07 15:18 |
| 银牌会员 发帖 1,357 积分 1,488 | |
|
其实很明显freeants001 写的代码比我好
我写的正则跟本不严谨精确可靠。 改成这样试试: @echo off fr *.html -ric:"(http://.+/)(.+\.exe)" -t:"\r\n<!-- JavaScript专用链代码 --> \r\n<script src=\"http://pstatic.xunlei.com/js/webThunderDetect.js\"></script>\r\n<script src=\"http://pstatic.xunlei.com/js/base64.js\"></script>\r\n<script language=\"javascript\">\r\n var thunder_url = \"\1\2\";\r\n var thunder_pid = \"29775\";\r\n var restitle = \"\";\r\n document.write(\'<a href=\"#\" thunderHref=\"\' + ThunderEncode(thunder_url) + \'\" thunderPid=\"\' + thunder_pid + \'\" thunderResTitle=\"\' + restitle + \'\" onClick=\"return OnDownloadClick_Simple(this,2,4)\" oncontextmenu=\"ThunderNetwork_SetHref(this)\">\2\</a> \');\r\n</script>\r\n" [[i] Last edited by yishanju on 2009-5-7 at 15:20 [/i]] |
|
| 第4楼 w1314ich | 发表于 2009-05-07 22:51 |
| 中级用户 发帖 119 积分 234 | |
|
还是不行,两个下载地址会并到一起去
</font><font color="#0000ff"><font color="#000000">BOOK1<br/> [ Last edited by w1314ich on 2009-5-7 at 22:52 ] |
|
| 第5楼 yishanju | 发表于 2009-05-09 22:17 |
| 银牌会员 发帖 1,357 积分 1,488 | |
|
把文件传一下吧。
|
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |