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

 

 


Tema destacado: Como proteger una cartera - billetera de Bitcoin


  Mostrar Mensajes
Páginas: 1 [2] 3 4 5
11  Programación / .NET (C#, VB.NET, ASP) / Re: EJECUTAR CMD EN APLICACIÓN .NET en: 13 Noviembre 2014, 15:51 pm
Depende.

1) ¿Al clickar en el linklabel es cuando quieres detener Ping?


Si. Quiero que al hacer clic en el linklabel se cancele el task. Trato de entender el código pero ya me confundí :(

Disculpa por tanta molestia elektro.
12  Programación / .NET (C#, VB.NET, ASP) / Re: EJECUTAR CMD EN APLICACIÓN .NET en: 12 Noviembre 2014, 17:56 pm
De nada, para eso estamos, de todas formas esto que te expliqué es quizás lo más básico de la programación asíncrona en .Net.


Tengo un inconveniente y quisiera que me ayudes. En el código que me entregaste sólo aumenté el -t al comando ping pero al crear un linklabel para que vacie los campos, el comando ping se sigue ejecutando. Como lo puedo parar?

Código
  1. ...
  2. Private ReadOnly Property PingArguments As String
  3.        Get
  4.            Return String.Format("ping.exe ""{0}.{1}.{2}.{3}"" -t",
  5.                                TextBox1.Text, TextBox2.Text,
  6.                                TextBox3.Text, TextBox4.Text)
  7.        End Get
  8.    End Property
  9. ...
  10.  
  11. Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
  12.        Dim x As Control
  13.        For Each x In Me.Controls
  14.            If TypeOf x Is System.Windows.Forms.TextBox Then x.Text = ""
  15.        Next
  16.  
  17.    End Sub
13  Programación / .NET (C#, VB.NET, ASP) / Re: EJECUTAR CMD EN APLICACIÓN .NET en: 11 Noviembre 2014, 19:13 pm

Sea cual sea el error que te indique imagino que es porque estás intentando modificar un control desde un Thread distinto al Thread donde creaste el cotnrol. es decir, tienes el control txtResults en el thread "X" e intentas modificarlo desde el thread "Y", no puedes modificar un control así como así desde otro thread, primero debes comprobar si el control necesita ser invocado, y después, invocarlo.


Woww.. en serio eres un capo en esto. Muchas gracias por tu ayuda. Era exactamente lo que queria. Prometo que seré mas cuidadosa con mis publicaciones y poner la información completa.

Gracias por todo.  :D
14  Programación / .NET (C#, VB.NET, ASP) / EJECUTAR CMD EN APLICACIÓN .NET en: 11 Noviembre 2014, 15:39 pm
Buen día a todos, quisiera que me apoyen en poder ver cual es mi error ya que al momento de ejecutar la app se marca error en la linea txtResults.Text = SR.ReadToEnd.
La idea es que en vez que se muestre en la ventana del cmd, figure en el cuadro de texto txtResults y sería mucho mejor si fuera continuo o sea el resultado de ping 127.0.0.1 -t figure en el cuadro de texto.

Código
  1. Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
  2.        Dim CMDThread As New Threading.Thread(AddressOf CMDAutomate)
  3.        CMDThread.Start()
  4.    End Sub
  5.    Private Sub CMDAutomate()
  6.        Dim PROCESO As New Process
  7.        Dim INFO As New System.Diagnostics.ProcessStartInfo
  8.        INFO.FileName = "cmd"
  9.        INFO.RedirectStandardInput = True
  10.        INFO.RedirectStandardOutput = True
  11.        INFO.UseShellExecute = False
  12.        PROCESO.StartInfo = INFO
  13.        PROCESO.Start()
  14.        Dim SR As System.IO.StreamReader = PROCESO.StandardOutput
  15.        Dim SW As System.IO.StreamWriter = PROCESO.StandardInput
  16.        Dim comandoping As String = String.Concat("ping ", TextBox1.Text, ".", TextBox2.Text, ".", TextBox3.Text, ".", TextBox4.Text)
  17.        SW.WriteLine(comandoping)
  18.        SW.WriteLine("exit")
  19.        txtResults.Text = SR.ReadToEnd
  20.        SW.Close()
  21.        SR.Close()
  22.    End Sub

Gracias por todo. Saludos.
15  Programación / .NET (C#, VB.NET, ASP) / REDUCIR CÓDIGO.NET en: 7 Julio 2014, 23:08 pm
Hola a todos!
Estoy realizando una aplicación donde el cual tiene 3 botones en donde se ejecutan diferentes comandos en cada botón a un mismo archivo (la aplicación es un convertidor). La aplicación ya esta hecha, lo que pasa es que se repite el código varias veces, entonces quisiera saber como podría hacer para que  se realizo el evento click en tal botón entonces ejecutar cierto comando.

No se si me dejo entender. Pero de todas maneras adjuntaré el código completo.

pd. Mi problema también está en que no imprime en archivo de texto.

Código
  1. Imports System
  2. Imports System.IO
  3. Imports System.IO.StreamWriter
  4.  
  5. Public Class Form1
  6.    Inherits System.Windows.Forms.Form
  7.  
  8.    Private Results As String
  9.    Private Delegate Sub delUpdate()
  10.    Private Finished As New delUpdate(AddressOf UpdateText)
  11.  
  12.    Private Sub btnexaminar_Click(sender As Object, e As EventArgs) Handles btnexaminar.Click
  13.        Dim Dir As New FolderBrowserDialog
  14.        If Dir.ShowDialog = Windows.Forms.DialogResult.OK Then
  15.            TextBox1.Text = Dir.SelectedPath
  16.        End If
  17.    End Sub
  18.  
  19.    Private Sub btndat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndat.Click
  20.        Dim midirectorio As String = TextBox1.Text
  21.        Dim CMDThread As New Threading.Thread(AddressOf CMDAutomate)
  22.        If midirectorio = "" Then
  23.            MessageBox.Show("Debe seleccionar la ruta donde se encuentra la data", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
  24.        Else
  25.            My.Computer.FileSystem.CopyFile("C:\Program Files\convert data\runpkr00.exe", midirectorio & "\runpkr00.exe", Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
  26.        End If
  27.        CMDThread.Start()
  28.  
  29.  
  30.    End Sub
  31.    Private Sub CMDAutomate()
  32.        Dim midirectorio As String = TextBox1.Text
  33.        Dim myprocess As New Process
  34.        Dim StartInfo As New System.Diagnostics.ProcessStartInfo
  35.        StartInfo.FileName = "cmd"
  36.        StartInfo.RedirectStandardInput = True
  37.        StartInfo.RedirectStandardOutput = True
  38.        StartInfo.UseShellExecute = False
  39.        StartInfo.CreateNoWindow = True
  40.        myprocess.StartInfo = StartInfo
  41.        myprocess.Start()
  42.        Dim SR As System.IO.StreamReader = myprocess.StandardOutput
  43.        Dim SW As System.IO.StreamWriter = myprocess.StandardInput
  44.        Dim comando As String
  45.        Dim cmdir As String
  46.        Dim nombre As String
  47.  
  48.        For Each file As String In My.Computer.FileSystem.GetFiles(midirectorio, FileIO.SearchOption.SearchTopLevelOnly, "*.T01")
  49.  
  50.            nombre = My.Computer.FileSystem.GetName(file)
  51.            cmdir = "cd " & midirectorio
  52.            comando = "runpkr00.exe -d -s " & nombre
  53.            SW.WriteLine(cmdir)
  54.            SW.WriteLine(comando)
  55.            'Results = SR.ReadToEnd
  56.            'SW.Close()
  57.            'SR.Close()
  58.            'Invoke(Finished)
  59.            MessageBox.Show("Conversión a DAT culminada." & vbNewLine & "Data: " & nombre, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
  60.        Next
  61.        Results = SR.ReadToEnd
  62.        SW.Close()
  63.        SR.Close()
  64.        Invoke(Finished)
  65.  
  66.    End Sub
  67.  
  68.    Private Sub UpdateText()
  69.  
  70.        'If Me.InvokeRequired = False Then
  71.        Dim midirectorio As String = TextBox1.Text
  72.        Dim strStreamW As Stream = Nothing
  73.        Dim strStreamWriter As StreamWriter = Nothing
  74.        Dim fecha As String = DateTime.Now.ToString("dd MMM HHmmss")
  75.        Dim rutarchivo As String = String.Concat(midirectorio, "log-", fecha & ".txt")
  76.        Windows.Forms.Cursor.Current = Cursors.WaitCursor
  77.        strStreamW = File.Create(rutarchivo)
  78.        strStreamWriter = New StreamWriter(strStreamW, System.Text.Encoding.Default)
  79.        strStreamWriter.WriteLine(Results)
  80.        strStreamWriter.Close()
  81.        ' Else
  82.        '  Dim D As delUpdate = New delUpdate(AddressOf UpdateText)
  83.        ' Me.Invoke(D)
  84.        ' End If
  85.    End Sub
  86.  
  87.    Private Sub btnrinex_Click(sender As System.Object, e As System.EventArgs) Handles btnrinex.Click
  88.        Dim midirectorio As String = TextBox1.Text
  89.        Dim CMD As New Threading.Thread(AddressOf CMDAutomaterin)
  90.        If midirectorio = "" Then
  91.            MessageBox.Show("Debe seleccionar la ruta donde se encuentra la data", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
  92.        Else
  93.            My.Computer.FileSystem.CopyFile("C:\Program Files\convert data\teqc.exe", midirectorio & "\teqc.exe", Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
  94.        End If
  95.        CMD.Start()
  96.    End Sub
  97.  
  98.  
  99.    Friend ReadOnly GPSDictionary As Dictionary(Of Integer, Integer) = Me.GetGPSDictionary
  100.    Private Function GetGPSDictionary() As Dictionary(Of Integer, Integer)
  101.  
  102.        Dim ThisYear As Integer = Now.Year
  103.        Dim DaysInThisYear As Integer = (From month As Integer In Enumerable.Range(1, 12)
  104.                                         Select DateTime.DaysInMonth(ThisYear, month)).Sum
  105.        Dim GPSWeeks As IEnumerable(Of Integer) = Enumerable.Range(1773 - 1, 1825)
  106.        Dim Result As New Dictionary(Of Integer, Integer)
  107.  
  108.        For Day As Integer = 1 To DaysInThisYear
  109.            Result.Add(Day, GPSWeeks(DatePart(DateInterval.WeekOfYear,
  110.                                              New DateTime(ThisYear, 1, 1).AddDays(Day - 1))))
  111.        Next Day
  112.  
  113.        Return Result
  114.    End Function
  115.  
  116.    Private Sub CMDAutomaterin()
  117.        Dim midirectorio As String = TextBox1.Text
  118.        Dim myprocess As New Process
  119.        Dim StartInfo As New System.Diagnostics.ProcessStartInfo
  120.        StartInfo.FileName = "cmd"
  121.        StartInfo.RedirectStandardInput = True
  122.        StartInfo.RedirectStandardOutput = True
  123.        StartInfo.UseShellExecute = False
  124.        StartInfo.CreateNoWindow = True
  125.        myprocess.StartInfo = StartInfo
  126.        myprocess.Start()
  127.        Dim SR As System.IO.StreamReader = myprocess.StandardOutput
  128.        Dim SW As System.IO.StreamWriter = myprocess.StandardInput
  129.        Dim comandodat As String
  130.        Dim comandorin As String
  131.        Dim cmdir As String
  132.        Dim nombre As String
  133.        Dim renombre As String
  134.  
  135.        For Each file As String In My.Computer.FileSystem.GetFiles(midirectorio, FileIO.SearchOption.SearchTopLevelOnly, "*.T01")
  136.  
  137.            nombre = Path.GetFileNameWithoutExtension(file)
  138.            renombre = Microsoft.VisualBasic.Left(nombre, Len(nombre) - 2) & "0"
  139.            Dim DayOfYear As Integer = Mid(nombre, 5, 3)
  140.            Dim semgps As Integer = Me.GPSDictionary(DayOfYear)
  141.  
  142.            cmdir = "cd " & midirectorio
  143.            comandodat = "runpkr00.exe -g -d " & nombre & ".t01"
  144.            comandorin = "teqc.exe +nav " & renombre & ".14n -O.int 5 -O.dec 5 -O.ag IGN-PERU -O.o CPG -week " & semgps & " -tr d " & nombre & ".tgd> " & renombre & ".14o"
  145.            SW.WriteLine(cmdir)
  146.            SW.WriteLine(comandodat)
  147.            SW.WriteLine(comandorin)
  148.            'Results = SR.ReadToEnd
  149.            ' SW.Close()
  150.            'SR.Close()
  151.            'Invoke(Finished)
  152.            MessageBox.Show("Conversión a RINEX culminada." & vbNewLine & "Data: " & nombre, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
  153.        Next
  154.        Results = SR.ReadToEnd
  155.        SW.Close()
  156.        SR.Close()
  157.        Invoke(Finished)
  158.  
  159.    End Sub
  160.  
  161.  
  162.  
  163.    Private Sub btntqc_Click(sender As Object, e As EventArgs) Handles btntqc.Click
  164.        Dim midirectorio As String = TextBox1.Text
  165.        Dim CMD As New Threading.Thread(AddressOf CMDAutomateqc)
  166.        If midirectorio = "" Then
  167.            MessageBox.Show("Debe seleccionar la ruta donde se encuentra la data", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
  168.        Else
  169.            My.Computer.FileSystem.CopyFile("C:\Program Files\convert data\teqc.exe", midirectorio & "\teqc.exe", Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
  170.        End If
  171.        CMD.Start()
  172.    End Sub
  173.  
  174.    Private Sub CMDAutomateqc()
  175.        Dim midirectorio As String = TextBox1.Text
  176.        Dim myprocess As New Process
  177.        Dim StartInfo As New System.Diagnostics.ProcessStartInfo
  178.        StartInfo.FileName = "cmd"
  179.        StartInfo.RedirectStandardInput = True
  180.        StartInfo.RedirectStandardOutput = True
  181.        StartInfo.UseShellExecute = False
  182.        StartInfo.CreateNoWindow = True
  183.        myprocess.StartInfo = StartInfo
  184.        myprocess.Start()
  185.        Dim SR As System.IO.StreamReader = myprocess.StandardOutput
  186.        Dim SW As System.IO.StreamWriter = myprocess.StandardInput
  187.        Dim comandorin As String
  188.        Dim cmdir As String
  189.        Dim nombre As String
  190.        Dim renombre As String
  191.  
  192.        For Each file As String In My.Computer.FileSystem.GetFiles(midirectorio, FileIO.SearchOption.SearchTopLevelOnly, "*.T01")
  193.  
  194.            nombre = Path.GetFileNameWithoutExtension(file)
  195.            renombre = Microsoft.VisualBasic.Left(nombre, Len(nombre) - 2) & "0"
  196.  
  197.            If System.IO.File.Exists(midirectorio & "\" & renombre & ".14n") And System.IO.File.Exists(midirectorio & "\" & renombre & ".14o") Then
  198.                cmdir = "cd " & midirectorio
  199.                comandorin = "teqc.exe -nav " & renombre & ".14n +qc " & renombre & ".14o"
  200.                SW.WriteLine(cmdir)
  201.                SW.WriteLine(comandorin)
  202.                'Results = SR.ReadToEnd
  203.                'SW.Close()
  204.                'SR.Close()
  205.                'Invoke(Finished)
  206.                MessageBox.Show("Quality Check." & vbNewLine & "Data: " & nombre, "Información", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1)
  207.            Else
  208.                MessageBox.Show("Se necesitan de los archivos RINEX (14n y 14o)" & vbNewLine & "Solución: Clic en el Botón RINEX.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)
  209.            End If
  210.        Next
  211.        Results = SR.ReadToEnd
  212.        SW.Close()
  213.        SR.Close()
  214.        Invoke(Finished)
  215.  
  216.    End Sub
16  Programación / .NET (C#, VB.NET, ASP) / Re: ARREGLOS VISUAL.NET en: 3 Julio 2014, 22:34 pm
es muy facil de adaptar, incluso puedes crear una función de uso genérico para devolver todos los datos necesarios (dias, semanas gps) en un objeto, ejemplo:


Elektro, muchas gracias por apoyarme. Está OK  :D
17  Programación / .NET (C#, VB.NET, ASP) / Re: ARREGLOS VISUAL.NET en: 30 Junio 2014, 18:31 pm




Está muy bien, ahora trato de adecuar tu codigo a mi aplicacion, ya que el día lo tendria que ingresar en un text ejem: 52 y que me de como resultado la semana ejem: del dia 52 la semana gps es 1780.

Gracias elektro =)
18  Programación / .NET (C#, VB.NET, ASP) / ARREGLOS VISUAL.NET en: 27 Junio 2014, 23:38 pm
Hola, soy nueva con lo que es el desarrollo pero estoy intentando en que me salga un simulador de semana gps (referencia:  http://gps.geo.upm.es/www/calactal.htm) donde al colocar el día (del 1 al 365) me bote como resultado la semana gps que le corresponde: ejem:  034 corresponde a 1778. El código que generé y el cual no me funciona, es el siguiente:


           
Código
  1. Dim semanagps As Integer
  2.            Dim i As Integer = textbox1.text
  3.            Dim numdia(i) As Integer
  4.  
  5.            numdia(0) = Nothing  
  6.            numdia(1) = 1773          'si nos fijamos en el calendario la semana 1773
  7.            numdia(2) = 1773          'tiene del día 1 al 4 y las demás semanas tendrán
  8.            numdia(3) = 1773          'los siete días que comprende la semana, es por
  9.            numdia(4) = 1773          'ello que genero el for.
  10.            For i = 5 To 365 Step 1
  11.                For k = 1773 To 1825 Step 1
  12.                   For j = 1 To 7 Step 1
  13.                       numdia(i) = k + 1
  14.                    Next
  15.                Next
  16.            Next
  17.  
  18.            semanagps = numdia(i)

De repente mi lógica esta mal, quisiera que me apoyen por favor.

Gracias de antemano.


19  Programación / .NET (C#, VB.NET, ASP) / Re: COMANDOS MULTIPLES - VB en: 19 Junio 2014, 16:26 pm
Ok, intenta llamar a la función dentro del mismo hilo para que la aplicación te bote el error y "a la fuerza" se detenga la ejecución. De esta manera podrás ver por qué la segunda vez que se ejecuta "Results = SR.ReadToEnd" No te funciona.

Estoy viendo otra cosa: No veo en ninguna parte del código que declares la variable Results. Puedes por favor poner cómo la declaras, creo que el error puede estar ahí.

Aquí te paso todo el código de mi aplicación pero ahora tengo otro problema y es que al momento de quitarle todos los puntos de interrupción ya no me ejecuta, se queda en My.Computer.FileSystem.CopyFile .
Cuando le quito el código
Código
  1. 'Results = SR.ReadToEnd
  2.            'SW.Close()
  3.            'SR.Close()
  4.            'Invoke(Finished)
y coloco el punto de interrupción en el for each me corre todo, algo debe de pasar con eso.



 
Código
  1. Imports System
  2. Imports System.IO
  3. Imports System.IO.StreamWriter
  4.  
  5. Public Class Form1
  6.    Inherits System.Windows.Forms.Form
  7.  
  8.    Private Results As String
  9.    Private Delegate Sub delUpdate()
  10.    Private Finished As New delUpdate(AddressOf UpdateText)
  11.  
  12.  Private Sub btnexaminar_Click(sender As Object, e As EventArgs) Handles btnexaminar.Click
  13.        Dim Dir As New FolderBrowserDialog
  14.        If Dir.ShowDialog = Windows.Forms.DialogResult.OK Then
  15.            TextBox1.Text = Dir.SelectedPath
  16.        End If
  17.    End Sub
  18.  
  19.    Private Sub btndat_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btndat.Click
  20.        Dim midirectorio As String = TextBox1.Text
  21.        Dim CMDThread As New Threading.Thread(AddressOf CMDAutomate)
  22.        If midirectorio = "" Then
  23.            MessageBox.Show("Debe seleccionar la ruta donde se encuentra la data", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error)
  24.        Else
  25.            My.Computer.FileSystem.CopyFile("C:\Program Files\convert data\runpkr00.exe", midirectorio & "\runpkr00.exe", Microsoft.VisualBasic.FileIO.UIOption.OnlyErrorDialogs, Microsoft.VisualBasic.FileIO.UICancelOption.DoNothing)
  26.        End If
  27.        CMDThread.Start()
  28.  
  29.    End Sub
  30.  
  31.    Private Sub CMDAutomate()
  32.        Dim midirectorio As String = TextBox1.Text
  33.        Dim myprocess As New Process
  34.        Dim StartInfo As New System.Diagnostics.ProcessStartInfo
  35.        StartInfo.FileName = "cmd"
  36.        StartInfo.RedirectStandardInput = True
  37.        StartInfo.RedirectStandardOutput = True
  38.        StartInfo.UseShellExecute = False
  39.        StartInfo.CreateNoWindow = True
  40.        myprocess.StartInfo = StartInfo
  41.        myprocess.Start()
  42.        Dim SR As System.IO.StreamReader = myprocess.StandardOutput
  43.        Dim SW As System.IO.StreamWriter = myprocess.StandardInput
  44.        Dim comando As String
  45.        Dim cmdir As String
  46.        Dim nombre As String
  47.  
  48.        For Each file As String In My.Computer.FileSystem.GetFiles(midirectorio, FileIO.SearchOption.SearchAllSubDirectories, "*.T01")
  49.  
  50.            nombre = My.Computer.FileSystem.GetName(file)
  51.            cmdir = "cd " & midirectorio
  52.            comando = "runpkr00.exe -d -s " & nombre
  53.            SW.WriteLine(cmdir)
  54.            SW.WriteLine(comando)
  55.            'Results = SR.ReadToEnd
  56.            'SW.Close()
  57.            'SR.Close()
  58.            'Invoke(Finished)
  59.        Next
  60.  
  61.        SW.Close()
  62.        SR.Close()
  63.  
  64.    End Sub
  65.  
  66.   Private Sub UpdateText()
  67.        Dim midirectorio As String = TextBox1.Text
  68.        Dim strStreamW As Stream = Nothing
  69.        Dim strStreamWriter As StreamWriter = Nothing
  70.        Dim fecha As String = DateTime.Now.ToString("dd MMM HHmmss") & ".txt"
  71.        Windows.Forms.Cursor.Current = Cursors.WaitCursor
  72.        Dim rutarchivo As String = String.Concat(midirectorio, "log-", fecha)
  73.        strStreamW = File.Create(rutarchivo)
  74.        strStreamWriter = New StreamWriter(strStreamW, System.Text.Encoding.Default)
  75.        strStreamWriter.WriteLine(Results)
  76.        strStreamWriter.Close()
  77.    End Sub
  78.  
20  Programación / .NET (C#, VB.NET, ASP) / Re: COMANDOS MULTIPLES - VB en: 19 Junio 2014, 00:21 am
Eso significa que se produce el error en esa línea. Me imagino que la función es creada en un hilo independiente del hilo principal, por eso es que no te salta error sólo sale del bucle y de la función... Y YA!

Para comprobar qué tipo de error es coloca el for dentro del tray/catch y coloca el punto de interrupción en la línea correspondiente al cath (como te indiqué en el código anterior) en la variable "e" estará la información correspondiente al error. Dinos cuál es para ver cómo se puede solucionar.

En Results me bota Nothing y como te digo se queda en results y termina. No llega a la parte del Catch.

Código
  1. Try
  2.            For Each file As String In My.Computer.FileSystem.GetFiles(midirectorio, FileIO.SearchOption.SearchAllSubDirectories, "*.T01")
  3.  
  4.                nombre = My.Computer.FileSystem.GetName(file)
  5.                cmdir = "cd " & midirectorio
  6.                comando = "runpkr00.exe -d -s " & nombre
  7.                SW.WriteLine(cmdir)
  8.                SW.WriteLine(comando)
  9.                Results = SR.ReadToEnd
  10.                'SW.Close()
  11.                'SR.Close()
  12.                Invoke(Finished)
  13.            Next
  14.            Catch e As Exception
  15.        End Try
  16.        SW.Close()
  17.        SR.Close()
Páginas: 1 [2] 3 4 5
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines