读书人

vb中二重起动check升级到vb.net中如何

发布时间: 2012-02-28 13:06:35 作者: rapoo

求助:vb中二重起动check升级到vb.net中怎么用?
vb中二重起动check App.PrevInstance在vb.net中怎么使用?
vb.net中有其他方法可以替代吗?
请大家指教,谢谢啦!

[解决办法]
抱歉,看错了。
Visual Basic Concepts
PrevInstance Property Changes in Visual Basic .NET
In Visual Basic 6.0, the PrevInstance property of the App object was used to determine if a previous instance of an application was running. There is no equivalent for this property in Visual Basic .NET; however, the following code can be used to test for a previous instance:

' Visual Basic .NET
Function PrevInstance() As Boolean
If Ubound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function
[解决办法]
2003的用法

' Visual Basic .NET
Function PrevInstance() As Boolean
If Ubound(Diagnostics.Process.GetProcessesByName(Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then
Return True
Else
Return False
End If
End Function

读书人网 >VB Dotnet

热点推荐