surongfu 发表于 2012-5-13 08:52:19

求助关于读取文本内容并显示(已解决)

本帖最后由 surongfu 于 2012-6-26 08:40 编辑

如图我想制作一个au3读取我指定的文本内容并显示出来我想在输入框输入3505211 点击ok后显示3505211 密码:1852356   输入31222则显示31222 密码:7875712

声明一下以下的文本内容是一个文件后缀名是.log但可以用文本打开
以下是我的文本内容:
00:56:28 05/13/12        CloseUserEvent, AuthCode:6438, CardNo:11225274, MachineName:, IP:
00:56:28 05/13/12        OpenUserEvent, AuthCode:6438,CardType:1, CardNo:3505211, Password:1852356, PasswordVerify:1, LoginLength:20, Name:2bee6da0b7faba005628张三, CertType:111,
00:56:47 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:57:07 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:57:27 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:57:47 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:58:07 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:58:27 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:58:47 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:58:55 05/13/12        CloseUserEvent, AuthCode:6438, CardNo:06083607, MachineName:, IP:
00:58:55 05/13/12        OpenUserEvent, AuthCode:6438,CardType:1, CardNo:341222, Password:7875712, PasswordVerify:1, LoginLength:20, Name:58457e3baeed9b005855李四, CertType:111,
00:59:07 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:59:28 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
00:59:48 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
01:00:15 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
01:00:35 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
01:00:55 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60
01:01:16 05/13/12        RegisterEvent, AuthCode:6438, IP:192.168.0.250, UDPPort:1899, TCPPort:8888, CommInterval:30, OverTimeInterval:60

chenronting 发表于 2012-5-13 09:44:57

..被你弄晕了!~

ooxxgod 发表于 2012-5-13 09:48:33

那个是MD数据库的 我也被你搞晕了

lxzan 发表于 2012-5-13 11:09:11

有点搞晕了.

楼上风云 发表于 2012-5-13 11:26:45

回复 1# surongfu

09年注册的“新手”朋友:
       读取输入框数据传入子函数
       子函数里用正则读取CardNo, 返回对应Password和NAME(是否为身份证号?,如是需要还原)

geary 发表于 2012-5-13 18:32:04

$a = InputBox(0,0)
$b = FileRead("1.log")
$c = StringRegExp($b,'CardNo:'&$a&', Password:(.*?), PasswordVerify',3)
MsgBox(0,0,$c)

lamlp 发表于 2012-5-14 11:24:55

正则表达式很强大,虽然不是太懂

tdcq7188 发表于 2012-5-15 08:20:32

过来看看,学习学习

luoluo942 发表于 2012-5-19 12:40:11

过来看看,学习学习

luoluo942 发表于 2012-5-19 12:40:41

正则表达式很强大,不断学习中
页: [1]
查看完整版本: 求助关于读取文本内容并显示(已解决)