shellexecute 执行完成_vb.net shell线程执行完成后再运行以后处理 函数
发布日期:2021-06-24 11:28:24 浏览次数:2 分类:技术文章

本文共 610 字,大约阅读时间需要 2 分钟。

Public Shared Function ExecuteCmd(ByVal cmd As String) As String

Dim startInfo As New ProcessStartInfo("cmd.exe")

With startInfo

.Arguments = "/C " + cmd

.RedirectStandardError = True

.RedirectStandardOutput = True

.UseShellExecute = False

.CreateNoWindow = True

.WindowStyle = ProcessWindowStyle.Hidden

End With

Dim p As Process = Process.Start(startInfo)

Dim strOutput As String = p.StandardOutput.ReadToEnd()

Dim strError As String = p.StandardError.ReadToEnd()

p.WaitForExit()

If (strOutput.Length <> 0) Then

Return strOutput

ElseIf (strError.Length <> 0) Then

Return strError

End If

Return "" End Function

转载地址:https://blog.csdn.net/weixin_32503531/article/details/112811035 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:css33d图片轮播_CSS3 3D效果轮播图
下一篇:书信要写标题吗_名师点评 | 2020年广东中考作文题目出炉,书信你会写吗?

发表评论

最新留言

很好
[***.229.124.182]2024年04月03日 22时38分59秒