elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: AIO elhacker.NET 2021 Compilación herramientas análisis y desinfección malware


  Mostrar Mensajes
Páginas: 1 ... 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 [547] 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 ... 1236
5461  Programación / Programación General / Re: Proyecto Instituto en: 16 Abril 2015, 19:25 pm
¿Elektro has probado si tu code es capaz de resolver captchas?

ReCaptchas de Google seguro que no, otro tipo de Capcthas pues... no lo he probado.

Sin embargo es de pago y no estoy yo para pagar licencias.

¿pagar licencia?, ¡no hay problema con eso! (¿cuantas veces lo voy a tener que linkear? :P)

Microsoft Visual Studio 2013 Ultimate + Resource Pack (Actualizado 09-Oct-2014)

PD: Revisa también la librería ABC OCR.Net que incluye el pack.
Pd2: Recuerda, puedes desempaquetar el instalador con InnoUnp.

Saludos!
5462  Foros Generales / Foro Libre / Re: Regalo cupón para cuenta premium (de 48 horas) en Uploaded.net en: 16 Abril 2015, 15:55 pm
Pues nada, ya hay "ganador", enhorabuena.
5463  Foros Generales / Foro Libre / Regalo cupón para cuenta premium (de 48 horas) en Uploaded.net en: 16 Abril 2015, 14:25 pm
Buenas!!!

Cómo ya hice alguna que otra vez aquí mismo, publico este mensaje para mostrar mi agradecimiento a todos los que me ayudaron en el pasado...y a todos los que forman "elhacker.net" y su foro, aunque no puedo hacerle un regalo a todos, pero si puedo sortearlo de esta manera al que esté más espavilado :P

Así que, una vez más vengo a regalar un código/cupón para una cuenta premium de 48 horas en Uploaded.Net a la primera persona que deje su comentario en este post.

Las únicas condiciones son que esa persona debe tener al menos 500 mensajes publicados, y debe estar registrado desde hace más de un año.
( tampoco pido mucho, solo que hayan colaborado lo suficiente en el foro ::) )

Saludos!
5464  Programación / Programación General / MOVIDO: TripleBuffer en java ??? en: 16 Abril 2015, 10:33 am
El tema ha sido movido a Java.

http://foro.elhacker.net/index.php?topic=433637.0
5465  Programación / Programación General / Re: Proyecto Instituto en: 16 Abril 2015, 09:47 am
¿Qué lenguaje?, el que prefieras que esté capacitado para el desarrollo iOS.

Por ejemplo, C# o VB.Net, utilizando Xamarin + Visual Studio para extender las capacidades de éste al desarrollo de aplicaciones para Android (aunque no necesitas VS, pero bueno, es lo que a mi me gusta).

¿Complicado?, pues depende, si no existen herramientas avanzadas para el lenguaje que escojas entonces significa que deberías desarrollar por ti mismo el algoritmo OCR, por ende... una completa locura.
En este caso, en la plataforma .Net, existen muchas herramientas (al igual que para C++ y Java por ejemplo, son lenguajes muy demandados y explotados, librerías inteligenes de OCR debe haberlas, pero las desconozco)

yo creo que librerías ocr listas deben haber bastantes, pero no creo que sea tan simple

Para .Net conozco varias librerías pero la que considero más útil es la librería de pago Aspose.OCR de Aspose.Net (es un conjunto de librerías), además de ser sencilla de utilizar, es bastante "lista", se puede aplicar distintas configuraciones de reconocimiento de idioma y se le puede "entrenar".

La he utilizado poco en el pasado pero guardé un ejemplo de uso, lo comparto por si sirve para esta duda:

Código
  1. Imports Aspose.OCR
  2.  
  3. Public Class Form1
  4.  
  5.    Private Sub Form1_Shown() Handles MyBase.Shown
  6.  
  7.        ' Resource file
  8.        Dim resourceFilePath As String = IO.Path.GetFullPath("C:\Aspose.OCR.Resources.zip")
  9.  
  10.        ' Source file: the file on which OCR will be performed
  11.        Dim imageFile As String = "C:\Sampleocr.bmp"
  12.  
  13.        Console.WriteLine("Performing OCR on " & imageFile & "....")
  14.  
  15.        ' Initialize OcrEngine
  16.        Dim ocr As New OcrEngine()
  17.  
  18.        ' Set the image
  19.        ocr.Image = ImageStream.FromFile(imageFile)
  20.  
  21.        ' Add language
  22.        ocr.Languages.AddLanguage(Language.Load("english"))
  23.  
  24.        ' Load the resource file
  25.        ocr.Resource = New IO.FileStream(resourceFilePath, IO.FileMode.Open)
  26.  
  27.        Try
  28.            ' Process the whole image
  29.            If ocr.Process() Then
  30.  
  31.                ' Get the complete recognized text found from the image
  32.                Console.WriteLine("Text recognized: " & ocr.Text.ToString())
  33.                IO.File.WriteAllText("C:\Output.txt", CType(ocr.Text, Object).ToString())
  34.  
  35.            End If
  36.  
  37.        Catch ex As Exception
  38.            Console.WriteLine("Exception: " & ex.ToString())
  39.  
  40.        End Try
  41.  
  42.    End Sub
  43.  
  44. End Class
5466  Programación / .NET (C#, VB.NET, ASP) / Re: diseño de interfaz en: 16 Abril 2015, 09:37 am
Interfáz ...de?.

...aplicación de escritorio?, aplicación web?, un juego?, un sistema operativo?.

¿Qué lenguaje, tecnología, y framework?.

¿La aplicación debe tener alguna funcionalidad en concreto?, es decir, ¿para que debe servir esa aplicación?.

No somos magos, especifica los detalles necesarios al formular una pregunta de programación!.



De todas formas por tus posts, intuyo que te refieres a una aplicación de escritorio en C# bajo tecnología WindowsForms y los controles de Microsoft .Net Framework, aunque sigo desconociendo la funcionalidad de dicha app.

Trata de diseñar una interfáz amigable, sencilla de entender, en ingles (¡NO EN ESPAÑOL!) o multi-idioma,
ponte en la piel del end-user, utiliza mensajes de ayuda (tooltips) para facilitarle el manejo por tu aplicación, si tienes textboxes u otros controles de edición entonces no te olvides de añadir text-hints (tips de ayuda que aparecen en controles vacíos para indicar de que manera se debe rellenar el texto),
y a menos que sea un programa muy simple con "un botón" entonces nunca metas toda la lógica del programa en un solo form, divide el programa en "secciones", el form principal con la funcionalidad principal, el form de opciones con la configuración del programa, etc...

Puedes utilizar pestañas (tabs) verticales o laterales, o un menú, entre otras técnicas.

También podrías implementar un menú Ribbon
Easily Add a Ribbon into a WinForms Application (C#)

Si te está permitido usar cualquier cosa para el diseño de la interfáz, entonces indiscutiblemente debes utilizar un set de controles de terceros (o también podrías personalizar por ti mismo los controles de Microsoft), sin duda alguna yo te recomiendo los controles de Telerik para permitirte desarrollar una aplicación con una interfáz única y espléndida:
Telerik for WinForms

Otros controles muy buenos son:
Krypton
DotNetBar

Si prefieres algún recurso gratuito (no te lo recmiendo) siempre hay muchos controles gratuitos en la página CodeProject, además de tutoriales, etc...

Cómo este, lo saqué de dicha página (para que te hagas una idea):
[APORTE] Amazing ProgressBar

El compañero @Doddy compartió unos themes bastante interesantes:
[Tutorial] Skins para C#

Yo compartí el source de algunos user-control que desarrollé cómo este:
[SOURCE] ElektroListBox v2.1

Por último, si quieres intentar impresionar a tu profesor/a para ganar "puntos" entonces esta vez intenta trabajar de una manera profesional, trata de diseñar un mockup (una especie de Sketch de aplicaciones) y enséñale eso antes de implementar el diseño en la aplicación.

Yo te recomiendo esta aplicación:
Balsamiq Mockups

Pero también podrías usar:
PowerMockup
WireframeSketcher Studio

Saludos!
5467  Informática / Software / Re: kgb archiver en: 15 Abril 2015, 16:35 pm
Pense que desarrollaban su propio algoritmo je

no, pero para que todo quede dicho, supuestamente mejoraban algún aspecto del algoritmo original (no se que aspectos, ni tampoco lo que considerarán "mejora").

saludos
5468  Programación / Scripting / Re: FOR que ejcute script en subdirectorios en: 14 Abril 2015, 21:54 pm
Añádele el parámetro /R al FOR para habilitar la recursividad de archivos.

Código:
For /R %%# In () DO ()

Es algo muy básico, trata de buscar antes de preguntar:
For - Looping commands | Windows CMD | SS64.com
(ni siquiera debes buscar, tienes la documentación del FOR en la ayuda del comando, en consola: FOR /?)

Saludos
5469  Programación / .NET (C#, VB.NET, ASP) / Re: Librería de Snippets !! (Compartan aquí sus snippets) en: 14 Abril 2015, 13:09 pm
Una helper class para manejar los servicios de Windows.

Por el momento puede listar, iniciar, detener, y determinar el estado o el modo de inicio de un servicio.
(no lo he testeado mucho en profundidad)

Ejemplos de uso:
Código
  1.        Dim svcName As String = "themes"
  2.        Dim svcDisplayName As String = ServiceUtils.GetDisplayName(svcName)
  3.        Dim svcStatus As ServiceControllerStatus = ServiceUtils.GetStatus(svcName)
  4.        Dim svcStartMode As ServiceUtils.SvcStartMode = ServiceUtils.GetStartMode(svcName)
  5.  
  6.        ServiceUtils.SetStartMode(svcName, ServiceUtils.SvcStartMode.Automatic)
  7.        ServiceUtils.SetStatus(svcName, ServiceUtils.SvcStatus.Stop, wait:=True, throwOnStatusMissmatch:=True)

Source code:
Código
  1. ' ***********************************************************************
  2. ' Author   : Elektro
  3. ' Modified : 14-April-2015
  4. ' ***********************************************************************
  5. ' <copyright file="ServiceUtils.vb" company="Elektro Studios">
  6. '     Copyright (c) Elektro Studios. All rights reserved.
  7. ' </copyright>
  8. ' ***********************************************************************
  9.  
  10. #Region " Usage Examples "
  11.  
  12. 'Dim svcName As String = "themes"
  13. 'Dim svcDisplayName As String = ServiceUtils.GetDisplayName(svcName)
  14. 'Dim svcStatus As ServiceControllerStatus = ServiceUtils.GetStatus(svcName)
  15. 'Dim svcStartMode As ServiceUtils.SvcStartMode = ServiceUtils.GetStartMode(svcName)
  16.  
  17. 'ServiceUtils.SetStartMode(svcName, ServiceUtils.SvcStartMode.Automatic)
  18. 'ServiceUtils.SetStatus(svcName, ServiceUtils.SvcStatus.Stop, wait:=True, throwOnStatusMissmatch:=True)
  19.  
  20. #End Region
  21.  
  22. #Region " Option Statements "
  23.  
  24. Option Strict On
  25. Option Explicit On
  26. Option Infer Off
  27.  
  28. #End Region
  29.  
  30. #Region " Imports "
  31.  
  32. Imports Microsoft.Win32
  33. Imports System.ServiceProcess
  34.  
  35. #End Region
  36.  
  37. ''' <summary>
  38. ''' Contains related Windows service tools.
  39. ''' </summary>
  40. Public NotInheritable Class ServiceUtils
  41.  
  42. #Region " Enumerations "
  43.  
  44.    ''' <summary>
  45.    ''' Indicates the status of a service.
  46.    ''' </summary>
  47.    Public Enum SvcStatus
  48.  
  49.        ''' <summary>
  50.        ''' The service is running.
  51.        ''' </summary>
  52.        Start
  53.  
  54.        ''' <summary>
  55.        ''' The service is stopped.
  56.        ''' </summary>
  57.        [Stop]
  58.  
  59.    End Enum
  60.  
  61.    ''' <summary>
  62.    ''' Indicates the start mode of a service.
  63.    ''' </summary>
  64.    Public Enum SvcStartMode As Integer
  65.  
  66.        ''' <summary>
  67.        ''' Indicates that the service has not a start mode defined.
  68.        ''' Since a service should have a start mode defined, this means an error occured retrieving the start mode.
  69.        ''' </summary>
  70.        Undefinied = 0
  71.  
  72.        ''' <summary>
  73.        ''' Indicates that the service is to be started (or was started) by the operating system, at system start-up.
  74.        ''' The service is started after other auto-start services are started plus a short delay.
  75.        ''' </summary>
  76.        AutomaticDelayed = 1
  77.  
  78.        ''' <summary>
  79.        ''' Indicates that the service is to be started (or was started) by the operating system, at system start-up.
  80.        ''' If an automatically started service depends on a manually started service,
  81.        ''' the manually started service is also started automatically at system startup.
  82.        ''' </summary>
  83.        Automatic = 2 'ServiceStartMode.Automatic
  84.  
  85.        ''' <summary>
  86.        ''' Indicates that the service is started only manually,
  87.        ''' by a user (using the Service Control Manager) or by an application.
  88.        ''' </summary>
  89.        Manual = 3 'ServiceStartMode.Manual
  90.  
  91.        ''' <summary>
  92.        ''' Indicates that the service is disabled, so that it cannot be started by a user or application.
  93.        ''' </summary>
  94.        Disabled = 4 ' ServiceStartMode.Disabled
  95.  
  96.    End Enum
  97.  
  98. #End Region
  99.  
  100. #Region " Public Methods "
  101.  
  102.    ''' <summary>
  103.    ''' Retrieves all the services on the local computer, except for the device driver services.
  104.    ''' </summary>
  105.    ''' <returns>IEnumerable(Of ServiceController).</returns>
  106.    Public Shared Function GetServices() As IEnumerable(Of ServiceController)
  107.  
  108.        Return ServiceController.GetServices.AsEnumerable
  109.  
  110.    End Function
  111.  
  112.    ''' <summary>
  113.    ''' Gets the name of a service.
  114.    ''' </summary>
  115.    ''' <param name="svcDisplayName">The service's display name.</param>
  116.    ''' <returns>The service name.</returns>
  117.    ''' <exception cref="ArgumentException">Any service found with the specified display name.;svcDisplayName</exception>
  118.    Public Shared Function GetName(ByVal svcDisplayName As String) As String
  119.  
  120.        Dim svc As ServiceController = (From service As ServiceController In ServiceController.GetServices()
  121.                                        Where service.DisplayName.Equals(svcDisplayName, StringComparison.OrdinalIgnoreCase)
  122.                                        ).FirstOrDefault
  123.  
  124.        If svc Is Nothing Then
  125.            Throw New ArgumentException("Any service found with the specified display name.", "svcDisplayName")
  126.  
  127.        Else
  128.            Using svc
  129.                Return svc.ServiceName
  130.            End Using
  131.  
  132.        End If
  133.  
  134.    End Function
  135.  
  136.    ''' <summary>
  137.    ''' Gets the display name of a service.
  138.    ''' </summary>
  139.    ''' <param name="svcName">The service name.</param>
  140.    ''' <returns>The service's display name.</returns>
  141.    ''' <exception cref="ArgumentException">Any service found with the specified name.;svcName</exception>
  142.    Public Shared Function GetDisplayName(ByVal svcName As String) As String
  143.  
  144.        Dim svc As ServiceController = (From service As ServiceController In ServiceController.GetServices()
  145.                                        Where service.ServiceName.Equals(svcName, StringComparison.OrdinalIgnoreCase)
  146.                                        ).FirstOrDefault
  147.  
  148.        If svc Is Nothing Then
  149.            Throw New ArgumentException("Any service found with the specified name.", "svcName")
  150.  
  151.        Else
  152.            Using svc
  153.                Return svc.DisplayName
  154.            End Using
  155.  
  156.        End If
  157.  
  158.    End Function
  159.  
  160.    ''' <summary>
  161.    ''' Gets the status of a service.
  162.    ''' </summary>
  163.    ''' <param name="svcName">The service name.</param>
  164.    ''' <returns>The service status.</returns>
  165.    ''' <exception cref="ArgumentException">Any service found with the specified name.;svcName</exception>
  166.    Public Shared Function GetStatus(ByVal svcName As String) As ServiceControllerStatus
  167.  
  168.        Dim svc As ServiceController =
  169.            (From service As ServiceController In ServiceController.GetServices()
  170.             Where service.ServiceName.Equals(svcName, StringComparison.OrdinalIgnoreCase)
  171.            ).FirstOrDefault
  172.  
  173.        If svc Is Nothing Then
  174.            Throw New ArgumentException("Any service found with the specified name.", "svcName")
  175.  
  176.        Else
  177.            Using svc
  178.                Return svc.Status
  179.            End Using
  180.  
  181.        End If
  182.  
  183.    End Function
  184.  
  185.    ''' <summary>
  186.    ''' Gets the start mode of a service.
  187.    ''' </summary>
  188.    ''' <param name="svcName">The service name.</param>
  189.    ''' <returns>The service's start mode.</returns>
  190.    ''' <exception cref="ArgumentException">Any service found with the specified name.</exception>
  191.    ''' <exception cref="Exception">Registry value "Start" not found for service.</exception>
  192.    ''' <exception cref="Exception">Registry value "DelayedAutoStart" not found for service.</exception>
  193.    Public Shared Function GetStartMode(ByVal svcName As String) As SvcStartMode
  194.  
  195.        Dim reg As RegistryKey = Nothing
  196.        Dim startModeValue As Integer = 0
  197.        Dim delayedAutoStartValue As Integer = 0
  198.  
  199.        Try
  200.            reg = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\" & svcName, writable:=False)
  201.  
  202.            If reg Is Nothing Then
  203.                Throw New ArgumentException("Any service found with the specified name.", paramName:="svcName")
  204.  
  205.            Else
  206.                startModeValue = Convert.ToInt32(reg.GetValue("Start", defaultValue:=-1))
  207.                delayedAutoStartValue = Convert.ToInt32(reg.GetValue("DelayedAutoStart", defaultValue:=0))
  208.  
  209.                If startModeValue = -1 Then
  210.                    Throw New Exception(String.Format("Registry value ""Start"" not found for service '{0}'.", svcName))
  211.                    Return SvcStartMode.Undefinied
  212.  
  213.                Else
  214.                    Return DirectCast([Enum].Parse(GetType(SvcStartMode),
  215.                                                   (startModeValue - delayedAutoStartValue).ToString), SvcStartMode)
  216.  
  217.                End If
  218.  
  219.            End If
  220.  
  221.        Catch ex As Exception
  222.            Throw
  223.  
  224.        Finally
  225.            If reg IsNot Nothing Then
  226.                reg.Dispose()
  227.            End If
  228.  
  229.        End Try
  230.  
  231.    End Function
  232.  
  233.    ''' <summary>
  234.    ''' Gets the start mode of a service.
  235.    ''' </summary>
  236.    ''' <param name="svc">The service.</param>
  237.    ''' <returns>The service's start mode.</returns>
  238.    Public Shared Function GetStartMode(ByVal svc As ServiceController) As SvcStartMode
  239.  
  240.        Return GetStartMode(svc.ServiceName)
  241.  
  242.    End Function
  243.  
  244.    ''' <summary>
  245.    ''' Sets the start mode of a service.
  246.    ''' </summary>
  247.    ''' <param name="svcName">The service name.</param>
  248.    ''' <param name="startMode">The start mode.</param>
  249.    ''' <exception cref="ArgumentException">Any service found with the specified name.</exception>
  250.    ''' <exception cref="ArgumentException">Unexpected value.</exception>
  251.    Public Shared Sub SetStartMode(ByVal svcName As String,
  252.                                   ByVal startMode As SvcStartMode)
  253.  
  254.        Dim reg As RegistryKey = Nothing
  255.  
  256.        Try
  257.            reg = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Services\" & svcName, writable:=True)
  258.  
  259.            If reg Is Nothing Then
  260.                Throw New ArgumentException("Any service found with the specified name.", paramName:="svcName")
  261.  
  262.            Else
  263.  
  264.                Select Case startMode
  265.  
  266.                    Case SvcStartMode.AutomaticDelayed
  267.                        reg.SetValue("DelayedAutoStart", 1, RegistryValueKind.DWord)
  268.                        reg.SetValue("Start", SvcStartMode.Automatic, RegistryValueKind.DWord)
  269.  
  270.                    Case SvcStartMode.Automatic, SvcStartMode.Manual, SvcStartMode.Disabled
  271.                        reg.SetValue("DelayedAutoStart", 0, RegistryValueKind.DWord)
  272.                        reg.SetValue("Start", startMode, RegistryValueKind.DWord)
  273.  
  274.                    Case Else
  275.                        Throw New ArgumentException("Unexpected value.", paramName:="startMode")
  276.  
  277.                End Select
  278.  
  279.            End If
  280.  
  281.        Catch ex As Exception
  282.            Throw
  283.  
  284.        Finally
  285.            If reg IsNot Nothing Then
  286.                reg.Dispose()
  287.            End If
  288.  
  289.        End Try
  290.  
  291.    End Sub
  292.  
  293.    ''' <summary>
  294.    ''' Sets the start mode of a service.
  295.    ''' </summary>
  296.    ''' <param name="svc">The service.</param>
  297.    ''' <param name="startMode">The start mode.</param>
  298.    Public Shared Sub SetStartMode(ByVal svc As ServiceController,
  299.                                   ByVal startMode As SvcStartMode)
  300.  
  301.        SetStartMode(svc.ServiceName, startMode)
  302.  
  303.    End Sub
  304.  
  305.    ''' <summary>
  306.    ''' Sets the status of a service.
  307.    ''' </summary>
  308.    ''' <param name="svcName">The service name.</param>
  309.    ''' <param name="status">The desired service status.</param>
  310.    ''' <param name="wait">if set to <c>true</c> waits for the status change completition.</param>
  311.    ''' <param name="throwOnStatusMissmatch">
  312.    ''' If set to <c>true</c> throws an error when attempting to start a service that is started,
  313.    ''' or attempting to stop a service that is stopped.
  314.    ''' </param>
  315.    ''' <exception cref="ArgumentException">Any service found with the specified name.;svcName</exception>
  316.    ''' <exception cref="ArgumentException">Cannot start service because it is disabled.</exception>
  317.    ''' <exception cref="ArgumentException">Cannot start service because a dependant service is disabled.</exception>
  318.    ''' <exception cref="ArgumentException">The service is already running or pendng to run it.</exception>
  319.    ''' <exception cref="ArgumentException">The service is already stopped or pendng to stop it.</exception>
  320.    ''' <exception cref="ArgumentException">Unexpected enumeration value.</exception>
  321.    ''' <exception cref="Exception"></exception>
  322.    Public Shared Sub SetStatus(ByVal svcName As String,
  323.                                ByVal status As SvcStatus,
  324.                                Optional wait As Boolean = False,
  325.                                Optional ByVal throwOnStatusMissmatch As Boolean = False)
  326.  
  327.        Dim svc As ServiceController = Nothing
  328.  
  329.        Try
  330.            svc = (From service As ServiceController In ServiceController.GetServices()
  331.                   Where service.ServiceName.Equals(svcName, StringComparison.OrdinalIgnoreCase)
  332.                  ).FirstOrDefault
  333.  
  334.            If svc Is Nothing Then
  335.                Throw New ArgumentException("Any service found with the specified name.", "svcName")
  336.  
  337.            ElseIf GetStartMode(svc) = SvcStartMode.Disabled Then
  338.                Throw New Exception(String.Format("Cannot start or stop service '{0}' because it is disabled.", svcName))
  339.  
  340.            Else
  341.  
  342.                Select Case status
  343.  
  344.                    Case SvcStatus.Start
  345.  
  346.                        Select Case svc.Status
  347.  
  348.                            Case ServiceControllerStatus.Stopped,
  349.                                 ServiceControllerStatus.StopPending,
  350.                                 ServiceControllerStatus.Paused,
  351.                                 ServiceControllerStatus.PausePending
  352.  
  353.                                For Each dependantSvc As ServiceController In svc.ServicesDependedOn
  354.  
  355.                                    If GetStartMode(dependantSvc) = SvcStartMode.Disabled Then
  356.                                        Throw New Exception(String.Format("Cannot start service '{0}' because a dependant service '{1}' is disabled.",
  357.                                                                          svcName, dependantSvc.ServiceName))
  358.                                        Exit Select
  359.                                    End If
  360.  
  361.                                Next dependantSvc
  362.  
  363.                                svc.Start()
  364.                                If wait Then
  365.                                    svc.WaitForStatus(ServiceControllerStatus.Running)
  366.                                End If
  367.  
  368.                            Case ServiceControllerStatus.Running,
  369.                                 ServiceControllerStatus.StartPending,
  370.                                 ServiceControllerStatus.ContinuePending
  371.  
  372.                                If throwOnStatusMissmatch Then
  373.                                    Throw New Exception(String.Format("The service '{0}' is already running or pendng to run it.", svcName))
  374.                                End If
  375.  
  376.                        End Select
  377.  
  378.                    Case SvcStatus.Stop
  379.  
  380.                        Select Case svc.Status
  381.  
  382.                            Case ServiceControllerStatus.Running,
  383.                                 ServiceControllerStatus.StartPending,
  384.                                 ServiceControllerStatus.ContinuePending
  385.  
  386.                                svc.Stop()
  387.                                If wait Then
  388.                                    svc.WaitForStatus(ServiceControllerStatus.Stopped)
  389.                                End If
  390.  
  391.                            Case ServiceControllerStatus.Stopped,
  392.                                 ServiceControllerStatus.StopPending,
  393.                                 ServiceControllerStatus.Paused,
  394.                                 ServiceControllerStatus.PausePending
  395.  
  396.                                If throwOnStatusMissmatch Then
  397.                                    Throw New Exception(String.Format("The service '{0}' is already stopped or pendng to stop it.", svcName))
  398.                                End If
  399.  
  400.                        End Select
  401.  
  402.                    Case Else
  403.                        Throw New ArgumentException("Unexpected enumeration value.", paramName:="status")
  404.  
  405.                End Select
  406.  
  407.            End If
  408.  
  409.        Catch ex As Exception
  410.            Throw
  411.  
  412.        Finally
  413.            If svc IsNot Nothing Then
  414.                svc.Close()
  415.            End If
  416.  
  417.        End Try
  418.  
  419.    End Sub
  420.  
  421. #End Region
  422.  
  423. End Class
5470  Foros Generales / Foro Libre / Re: El español hablado en Andalucía en: 14 Abril 2015, 09:39 am
¿Soy el único que piensa que esto no tiene ningún sentido y estais llevando ya el tema hacia límites extremos?.

No se, pero por hacer una simple comparación, nunca he visto a alguien que por llamarle subnormal vaya y publique un post sobre el coeficiente intelectual de su ciudad o sobre psicología para intentar demostrar algo... xD. ¿se entiende, no?.

Saludos!
Páginas: 1 ... 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 [547] 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines