
13/01/2011, 13:12
|
 | | | Fecha de Ingreso: junio-2007 Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 17 años, 8 meses Puntos: 49 | |
Respuesta: evitar abrir un sistema mas de una vez Que tal Aquaventus, puedes utilizar algo como esto, el código esta en VB nada mas es que los pases a C#
Código vb:
Ver original'Creas una funcion como esta Function PrevInstance() As Boolean If UBound(System.Diagnostics.Process.GetProcessesByName(System.Diagnostics.Process.GetCurrentProcess.ProcessName)) > 0 Then Return True Application.DoEvents() Else Return False Application.DoEvents() End If End Function
Y en el evento Load de tu form principal haces la validación:
Código vb:
Ver originalIf PrevInstance() = True Then Application.DoEvents() MessageBox.Show("Ya Existe Una Instancia Abierta De La Aplicación", "Seguridad", MessageBoxButtons.OK, MessageBoxIcon.Warning) Application.Exit() End If
Saludos.
__________________ "SELECT * FROM Mujeres WHERE situacion NOT IN ('CASADAS','CON HIJOS','ATORMENTADAS','CUASI-ENNOVIADAS') AND personalidad <> 'INTENSA'" |