英文:
.NET 6: Process.Start("powerpnt.exe") doesn't work anymore
问题
使用Visual Basic .NET和.NET 6,Process.Start("powerpnt.exe")
不再起作用。现在调用其他应用程序的新方法是什么,而不必调用整个exe路径?
英文:
With Visual Basic .NET and .NET 6, Process.Start("powerpnt.exe")
doesn't work anymore. What is the new way of calling up other apps now without having to call the entire path to the exe?
答案1
得分: 1
你需要使用一个 ProcessStartInfo 对象,并将 UseShellExecute 设置为 True:
Dim psi As New ProcessStartInfo
With psi
.FileName = "powerpnt.exe"
.UseShellExecute = True
End With
System.Diagnostics.Process.Start(psi)
在 .NET 6 中,默认情况下 UseShellExecute 为 False(在 .NET Framework 中默认为 True)。
英文:
You need to use a ProcessStartInfo object and set UseShellExecute to True:
Dim psi As New ProcessStartInfo
With psi
.FileName = "powerpnt.exe"
.UseShellExecute = True
End With
System.Diagnostics.Process.Start(psi)
With .NET 6, UseShellExecute is False by default (it was True by default in the .NET Framework).
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论