VB如何实现全局钩子

如题`给个实例就行了`麻烦在每句旁边注明意思`简单点... 如题`给个实例就行了`麻烦在每句旁边注明意思`简单点 展开
 我来答
caiyiheng_ai
2008-07-31 · TA获得超过188个赞
知道小有建树答主
回答量:885
采纳率:0%
帮助的人:0
展开全部
OutputFile.Cells(1, 1) = "BSC"
OutputFile.Cells(1, 2) = "CODE"
OutputFile.Cells(1, 3) = "NAME"
OutputFile.Cells(1, 4) = "STATE"
OutputFile.Cells(1, 5) = "CAPACITY"
OutputFile.Cells(1, 6) = "USED"
OutputFile.Cells(1, 7) = "REQUEST STATUS"
Dim nun
nun = 1
txtdate = ""
'读文本,用字符型表示
Do While Not EOF(1)
Line Input #1, bb
txtdate = txtdate & bb
Loop
Debug.Print txtdate
'分解字符串txtdate,总的数据量用B表示
b = Split(txtdate, "LICENCE AND FEATURE HANDLING COMMAND <W7_> < ! ------------------------------------------------------------------------!")

For i = 0 To UBound(b) - 1
'消除多重空格
Do While InStr(b(i), " ") > 0
b(i) = Replace(b(i), " ", " ")
Loop
'处理每个分解的字符B

'获取BSC号
If UBound(Split(b(i), "/*** COMMAND NOT AUTHORIZED ***/ ")) < 1 Then
t = Split(b(i), "Starting MML commands execution in network element:")
step = Mid(t(1), 1, InStr(t(1), "!") - 1)

'统计FEATURE CODE的个数
gv0 = Split(b(i), "FEATURE CODE:..............")
gv1 = Split(b(i), "FEATURE NAME:..............")
gv2 = Split(b(i), "FEATURE STATE:.............")
gv3 = Split(b(i), "FEATURE CAPACITY:..........")
ccount = UBound(gv0)

ab = Split(b(i), "REQUEST STATUS --------------------------------------------------------")
abb = Trim(ab(1))
bs = Split(abb, "COMMAND EXECUTED")
baa = Trim(bs(0))

For j = 1 To ccount

tt0 = Split(gv0(j))
tt1 = Split(gv1(j))
tt2 = Split(gv2(j))
tt3 = Split(gv3(j))

nun = nun + 1

OutputFile.Cells(nun, 1) = step
OutputFile.Cells(nun, 2) = tt0(0)
OutputFile.Cells(nun, 3) = tt1(0)
OutputFile.Cells(nun, 4) = tt2(0)
OutputFile.Cells(nun, 5) = tt3(0)

la = Split(baa, " ")
For m = 1 To (UBound(la) + 1) / 3
z = (m - 1) * 3
If tt0(0) = la(z) Then
OutputFile.Cells(nun, 6) = la(z + 1)
OutputFile.Cells(nun, 7) = la(z + 2)
End If
Next

Next
End If
Next

Close #1

End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式