展开全部
假设你的Text支持换行,即Multiline=TRUE
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim FF As Long
Dim Strtemp As String
Shell "cmd.exe /c ipconfig /all >C:\1.txt ", vbHide
While Dir("C:\1.txt") = ""
DoEvents
Sleep 500
Wend
FF = FreeFile
Open "C:\1.txt" For Input As #FF
Strtemp = InputB(LOF(FF), #FF)
Close #FF
Text1 = StrConv(Strtemp, vbUnicode)
Kill "C:\1.txt"
End Sub
Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim FF As Long
Dim Strtemp As String
Shell "cmd.exe /c ipconfig /all >C:\1.txt ", vbHide
While Dir("C:\1.txt") = ""
DoEvents
Sleep 500
Wend
FF = FreeFile
Open "C:\1.txt" For Input As #FF
Strtemp = InputB(LOF(FF), #FF)
Close #FF
Text1 = StrConv(Strtemp, vbUnicode)
Kill "C:\1.txt"
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询