VB实现查看本机宽带IP

VB实现查看本机宽带IP,第1张

Option Explicit
Dim objEmail As Object
Dim strName As String
Private Declare Function URLDownloadToFile Lib "urlmon" Alias "URLDownloadToFileA" (ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As String, ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long
Public Function DownloadFile(URL As String, LocalFilename As String) As Boolean
Dim lngRetVal As Long
lngRetVal = URLDownloadToFile(0, URL, LocalFilename, 0, 0)
If lngRetVal = 0 Then DownloadFile = True
End Function
Public Function StrIp()
Dim l As String
Dim I As Integer
Dim K1 As Integer, K2 As Integer
DownloadFile "http://wwwip138com/ip2cityasp", "C:\tmptxt"
Open "C:\tmptxt" For Input As #1
Do Until EOF(1)
Line Input #1, l
For I = 1 To Len(l)
If Mid(l, I, 1) = "[" Then
K1 = I + 1
K2 = InStr(l, "]")
StrIp = Mid(l, K1, K2 - K1)
GoTo Js
End If
Next I
Loop
Js:
Close #1
Kill "C:\tmptxt"
End Function
Private Sub Command1_Click()
Print StrIp
End Sub
更多VB代码请关注我的博客:http://hibaiducom/zgmg

以上就是关于VB实现查看本机宽带IP全部的内容,包括:VB实现查看本机宽带IP、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9856700.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-02
下一篇 2023-05-02

发表评论

登录后才能评论

评论列表(0条)

保存