10/04/10 14:10
marco444
ciao,
come scritto nel titolo voglio evitare che il programma venga eseguito due volte, non so se c'è un modo piu semplice, ma io ho scritto un codice, penso che sia assurdo il mio metodo però, infatti non funziona, ditemi cosa puo non andare:
Dim a1 As String, c As String
Dim b
a1 = Application.ExecutablePath.ToString
b = Split(a1, "\"
c = Join(b, "\"
Dim numero As String
numero = b.Length - 1
Dim file1 As String
file1 = b(numero)
Dim esec As String
esec = file1.Replace(".exe", ""
Dim PrcProcesso As System.Diagnostics.Process()
PrcProcesso = Process.GetProcessesByName("esec"
If (PrcProcesso.Length > 0) Then
End
Else
End If
come scritto nel titolo voglio evitare che il programma venga eseguito due volte, non so se c'è un modo piu semplice, ma io ho scritto un codice, penso che sia assurdo il mio metodo però, infatti non funziona, ditemi cosa puo non andare:
Dim a1 As String, c As String
Dim b
a1 = Application.ExecutablePath.ToString
b = Split(a1, "\"
c = Join(b, "\"
Dim numero As String
numero = b.Length - 1
Dim file1 As String
file1 = b(numero)
Dim esec As String
esec = file1.Replace(".exe", ""
Dim PrcProcesso As System.Diagnostics.Process()
PrcProcesso = Process.GetProcessesByName("esec"
If (PrcProcesso.Length > 0) Then
End
Else
End If
aaa