This is the .Net equivalant
If Process.GetProcessesByName (Process.GetCurrentProcess.ProcessName).Length
> 1 Then
here is a usage example ( how i use it in a server component that i created
,,,, actually a bsiness logi remoting host )
<STAThreadAttribute()> _
Public Shared Sub Main()
' refuse to start multiple times on a system
If Process.GetProcessesByName _
(Process.GetCurrentProcess.ProcessName).Length > 1 Then
Dim result As Integer = MessageBox.Show _
("Another Instance of " & Process.GetCurrentProcess.ProcessName & " is
already running ! " & _
vbCrLf & "This is a server component and needs to run only once ", _
vbCrLf & "are you sure you want to start another instance ? ", _
MessageBoxButtons.YesNo, _
MessageBoxIcon.Question)
If result = 7 Then
Application.Exit()
End If
Else
Dim initForm As New frmMain
Application.Run()
End If
End Sub
Met vriendelijke groeten ,
kind regards,
Michel Posseth
Software developer [MCP]
"I have not failed. I've just found 10,000 ways that won't work."
Nohau systems B.V.
Division systems development
`s Gravelandseweg 398 A-C
3195 BK
Schiedam
Netherlands
Tel : + 31 (0) 10 8502812
e-mail :
(E-Mail Removed)
"Jaime Lucci" <(E-Mail Removed)> wrote in message
news:u%(E-Mail Removed)...
> There is any instruction that replace the App.PrevInstance which is used
> in
> VB6?
>
> Thanks.
>
>