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

 

 


Tema destacado: Recopilación Tutoriales y Manuales Hacking, Seguridad, Privacidad, Hardware, etc


  Mostrar Mensajes
Páginas: 1 ... 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 [585] 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 ... 1236
5841  Programación / .NET (C#, VB.NET, ASP) / Re: Obtener IP de una URL mediante VB. Net 2010 en: 4 Febrero 2015, 22:11 pm
en teoria, el primer valor del array es la IP, asi que no hace falta hacer el bucle for.

Código
  1. TextBox1.Text = ip(0).ToString

Hombre en teoría es la IP ya que es una lista de direcciones, el problema es que a veces el primer item de la colección suele ser una IPv6, a mi también me dió problemas en el pasado.



Bueno, he escrito un ejemplo para ayudarte a obtener las IPv4 asociadas con "X" página

Modo de empleo:
Código
  1.        Dim IPv4List As New List(Of String)(HostNameToIP("foro.elhacker.net", Net.Sockets.AddressFamily.InterNetwork))
  2.        Dim IPv6List As New List(Of String)(HostNameToIP("LOCALHOST", Net.Sockets.AddressFamily.InterNetworkV6))
  3.  
  4.        MessageBox.Show(IPv4List(0)) ' Result: 108.162.205.73
  5.        MessageBox.Show(IPv6List(0)) ' Result: ::1

Source:
Código
  1.    ' HostName To IP
  2.    ' By Elektro
  3.    '
  4.    ' Usage Examples :
  5.    ' MessageBox.Show(HostNameToIP("foro.elhacker.net", Net.Sockets.AddressFamily.InterNetwork).First)
  6.    '
  7.    ''' <summary>
  8.    ''' Gets the specified addresses associated to a Host.
  9.    ''' </summary>
  10.    ''' <param name="hotsName">The Host name.</param>
  11.    ''' <param name="addressFamily">The address family.</param>
  12.    ''' <returns>The addresses.</returns>
  13.    ''' <exception cref="System.NotImplementedException">Address filtering not implemented yet.</exception>
  14.    Public Function HostNameToIP(ByVal hotsName As String,
  15.                                 ByVal addressFamily As Net.Sockets.AddressFamily) As IEnumerable(Of String)
  16.  
  17.        Dim hostInfo As Net.IPHostEntry = Net.Dns.GetHostEntry(hotsName)
  18.        Dim addressList As IEnumerable(Of String)
  19.  
  20.        Try
  21.            hostInfo = Net.Dns.GetHostEntry(hotsName)
  22.  
  23.            Select Case addressFamily
  24.  
  25.                Case Net.Sockets.AddressFamily.InterNetwork,
  26.                    Net.Sockets.AddressFamily.InterNetworkV6 ' IPv4, IPv6.
  27.  
  28.                    addressList = From address As Net.IPAddress In hostInfo.AddressList
  29.                                  Where address.AddressFamily = addressFamily
  30.                                  Select (address.ToString)
  31.  
  32.                Case Else
  33.                    Throw New NotImplementedException("Address filtering not implemented yet.")
  34.  
  35.            End Select
  36.  
  37.        Catch ex As Net.Sockets.SocketException
  38.            Throw
  39.  
  40.        Catch ex As ArgumentNullException
  41.            Throw
  42.  
  43.        Catch ex As Exception
  44.            Throw
  45.  
  46.        End Try
  47.  
  48.        Return addressList
  49.  
  50.    End Function
5842  Programación / .NET (C#, VB.NET, ASP) / Re: Variable de longitud fija en: 4 Febrero 2015, 21:33 pm
Si lo que quieres es limitar la cantidad de caracteres de un String, puedes utilizar el buffer de un StringBuilder:
Código
  1. Dim sb As New StringBuilder(1, 5) ' máximo 5 caracteres.
  2. sb.Append("123456") ' 6 caracteres, dará error por sobrepasar el límite.

Si lo que quieres es un String de longitud variable pero que en principio contenga un número específico de caracteres, puedes usar el constructor del datatype String:
Código
  1. Dim str As New String(" "c, 10)

Si lo que quieres es crear un string de longitud fija, siempre puedes crear tu propia extensión de método, o type:

Modo de empleo:
Código
  1. Dim fixedStr As FixedLengthString
  2.  
  3. fixedStr = New FixedLengthString("", 10)
  4. MessageBox.Show("""" & fixedStr.ValueFixed & """") ' Result: "          "
  5.  
  6. fixedStr.ValueUnfixed = "12345"
  7. MessageBox.Show("""" & fixedStr.ValueFixed & """") ' Result: "1245      "
  8.  
  9. fixedStr.ValueUnfixed = "1234567890abc"
  10. MessageBox.Show("""" & fixedStr.ValueFixed & """") ' Result: "1234567890"

Source:
Código
  1. ' ***********************************************************************
  2. ' Author   : Elektro
  3. ' Modified : 04-February-2015
  4. ' ***********************************************************************
  5. ' <copyright file="FixedLengthString.vb" company="Elektro Studios">
  6. '     Copyright (c) Elektro Studios. All rights reserved.
  7. ' </copyright>
  8. ' ***********************************************************************
  9.  
  10. ''' <summary>
  11. ''' Defines a <see cref="String"/> with a fixed length.
  12. ''' </summary>
  13. Public NotInheritable Class FixedLengthString
  14.  
  15. #Region " Properties "
  16.  
  17.    ''' <summary>
  18.    ''' Gets or sets the fixed string length.
  19.    ''' </summary>
  20.    ''' <value>The fixed string length.</value>
  21.    Public Property FixedLength As Integer
  22.        Get
  23.            Return Me.fixedLength1
  24.        End Get
  25.        Set(ByVal value As Integer)
  26.            Me.fixedLength1 = value
  27.        End Set
  28.    End Property
  29.    ''' <summary>
  30.    ''' The fixed string length.
  31.    ''' </summary>
  32.    Private fixedLength1 As Integer
  33.  
  34.    ''' <summary>
  35.    ''' Gets or sets the padding character thath fills the string.
  36.    ''' </summary>
  37.    ''' <value>The padding character thath fills the string.</value>
  38.    Public Property PaddingChar As Char
  39.        Get
  40.            Return Me.paddingChar1
  41.        End Get
  42.        Set(ByVal value As Char)
  43.            Me.paddingChar1 = value
  44.        End Set
  45.    End Property
  46.    ''' <summary>
  47.    ''' The padding character thath fills the string.
  48.    ''' </summary>
  49.    Private paddingChar1 As Char
  50.  
  51.    ''' <summary>
  52.    ''' Gets or sets the unmodified string.
  53.    ''' </summary>
  54.    ''' <value>The unmodified string.</value>
  55.    Public Property ValueUnfixed As String
  56.        Get
  57.            Return Me.valueUnfixed1
  58.        End Get
  59.        Set(ByVal value As String)
  60.            Me.valueUnfixed1 = value
  61.        End Set
  62.    End Property
  63.    ''' <summary>
  64.    ''' The unmodified string.
  65.    ''' </summary>
  66.    Private valueUnfixed1 As String
  67.  
  68.    ''' <summary>
  69.    ''' Gets the fixed string.
  70.    ''' </summary>
  71.    ''' <value>The fixed string.</value>
  72.    Public ReadOnly Property ValueFixed As String
  73.        Get
  74.            Return Me.FixLength(Me.valueUnfixed1, Me.fixedLength1, Me.paddingChar1)
  75.        End Get
  76.    End Property
  77.  
  78. #End Region
  79.  
  80. #Region " Constructors "
  81.  
  82.    ''' <summary>
  83.    ''' Prevents a default instance of the <see cref="FixedLengthString" /> class from being created.
  84.    ''' </summary>
  85.    Private Sub New()
  86.    End Sub
  87.  
  88.    ''' <summary>
  89.    ''' Initializes a new instance of the <see cref="FixedLengthString" /> class.
  90.    ''' </summary>
  91.    ''' <param name="value">The string value.</param>
  92.    ''' <param name="fixedLength">The fixed string length.</param>
  93.    ''' <param name="paddingChar">The padding character thath fills the string.</param>
  94.    Public Sub New(ByVal value As String,
  95.                   ByVal fixedLength As Integer,
  96.                   Optional ByVal paddingChar As Char = " "c)
  97.  
  98.        Me.valueUnfixed1 = value
  99.        Me.fixedLength1 = fixedLength
  100.        Me.paddingChar1 = paddingChar
  101.  
  102.    End Sub
  103.  
  104. #End Region
  105.  
  106. #Region " Public Methods "
  107.  
  108.    ''' <summary>
  109.    ''' Returns a <see cref="System.String" /> that represents this instance.
  110.    ''' </summary>
  111.    ''' <returns>A <see cref="System.String" /> that represents this instance.</returns>
  112.    Public Overrides Function ToString() As String
  113.        Return Me.ValueFixed
  114.    End Function
  115.  
  116. #End Region
  117.  
  118. #Region " Private Methods "
  119.  
  120.    ''' <summary>
  121.    ''' Fixes the length of the specified string.
  122.    ''' </summary>
  123.    ''' <param name="value">The string value.</param>
  124.    ''' <param name="fixedLength">The fixed string length.</param>
  125.    ''' <param name="paddingChar">The padding character thath fills the string.</param>
  126.    ''' <returns>System.String.</returns>
  127.    Private Function FixLength(ByVal value As String,
  128.                               ByVal fixedLength As Integer,
  129.                               ByVal paddingChar As Char) As String
  130.  
  131.        If (value.Length > fixedLength) Then
  132.            Return value.Substring(0, fixedLength)
  133.        Else
  134.            Return value.PadRight(fixedLength, paddingChar)
  135.        End If
  136.  
  137.    End Function
  138.  
  139. #End Region
  140.  
  141. End Class
5843  Programación / .NET (C#, VB.NET, ASP) / Re: Puedo grabar en un txt varios listbox ? en: 4 Febrero 2015, 18:42 pm
Hola Luis

Simplemente podrías serializar los datos en un archivo binario si tu intención es cargarlo de nuevo al programa, es algo muy facil, pero creo que no es el caso lo que quieres hacer, así que esto requiere mucha más escritura.

He escrito este código hardcodeado, optimizado para un conjunto de listas con cantidad de items indefinida en cada lista, y con longitud de item indefinida.

Nota: No lo he testeado mucho, quizás pueda haber agún error en ciertas circunstancias.


Output:
Código:
ListBox1      ListBox2      ListBox3      ListBox4
********      ********      ********      ********
a1qwerty      a2            a3            a4      
qwertyqw                  
erty                      
--------      --------      --------      --------
b1            b2            b3            b4      
--------      --------      --------      --------
c1                          c3                    
--------      --------      --------      --------
                            d3                    
--------      --------      --------      --------


Source:
Código
  1. Imports System.IO
  2. Imports System.Text
  3.  
  4. Public Class TestForm
  5.  
  6.    Private Sub Test() Handles Button1.Click
  7.  
  8.        Dim lbs As ListBox() = {ListBox1, ListBox2, ListBox3, ListBox4}
  9.        Dim spacing As Integer = 6 ' The horizontal spacing between columns.
  10.        Dim filaPath As String = Path.Combine(Application.StartupPath, "Test.txt")
  11.        Dim item1Parts As IEnumerable(Of String) = {}
  12.        Dim item2Parts As IEnumerable(Of String) = {}
  13.        Dim item3Parts As IEnumerable(Of String) = {}
  14.        Dim item4Parts As IEnumerable(Of String) = {}
  15.        Dim maxItemCount As Integer
  16.        Dim maxItemPartCount As Integer
  17.        Dim sb As New StringBuilder
  18.  
  19.        ' Get the max item count in listboxes.
  20.        maxItemCount = (From lb As ListBox In lbs
  21.                                       Order By lb.Items.Count Descending
  22.                                       Select lb.Items.Count).First
  23.  
  24.        ' Write column names.
  25.        sb.AppendLine(String.Format("{1}{0}{2}{0}{3}{0}{4}",
  26.                      New String(" "c, spacing),
  27.                      lbs(0).Name, lbs(1).Name,
  28.                      lbs(2).Name, lbs(3).Name))
  29.  
  30.        ' Write column separator.
  31.        sb.AppendLine(String.Format("{1}{0}{2}{0}{3}{0}{4}",
  32.                      New String(" "c, spacing),
  33.                      New String("*"c, lbs(0).Name.Length),
  34.                      New String("*"c, lbs(1).Name.Length),
  35.                      New String("*"c, lbs(2).Name.Length),
  36.                      New String("*"c, lbs(3).Name.Length)))
  37.  
  38.        ' Iterate listbox items.
  39.        For index As Integer = 0 To (maxItemCount - 1)
  40.  
  41.            ' If item at index exist...
  42.            If lbs(0).Items.Count > index Then
  43.                item1Parts = SplitByLength(lbs(0).Items(index).ToString, lbs(0).Name.Length)
  44.            End If
  45.  
  46.            If lbs(1).Items.Count > index Then
  47.                item2Parts = SplitByLength(lbs(1).Items(index).ToString, lbs(1).Name.Length)
  48.            End If
  49.  
  50.            If lbs(2).Items.Count > index Then
  51.                item3Parts = SplitByLength(lbs(2).Items(index).ToString, lbs(2).Name.Length)
  52.            End If
  53.  
  54.            If lbs(3).Items.Count > index Then
  55.                item4Parts = SplitByLength(lbs(3).Items(index).ToString, lbs(3).Name.Length)
  56.            End If
  57.  
  58.            If (item1Parts.Count > 1) OrElse
  59.               (item2Parts.Count > 1) OrElse
  60.               (item3Parts.Count > 1) OrElse
  61.               (item4Parts.Count > 1) Then
  62.  
  63.                ' Get the max item count in itemParts.
  64.                maxItemPartCount = (From col As IEnumerable(Of String)
  65.                                    In {item1Parts, item2Parts, item3Parts, item4Parts}
  66.                                    Order By col.Count Descending
  67.                                    Select col.Count).First
  68.  
  69.                For x As Integer = 0 To (maxItemPartCount - 1)
  70.  
  71.                    ' Write multiple items rows.
  72.                    sb.AppendLine(String.Format("{1}{0}{2}{0}{3}{0}{4}",
  73.                                      New String(" "c, spacing),
  74.                                      If(item1Parts.Count <= x, String.Empty,
  75.                                         item1Parts(x) & New String(" "c, lbs(0).Name.Length - item1Parts(x).Length)),
  76.                                      If(item2Parts.Count <= x, String.Empty,
  77.                                         item2Parts(x) & New String(" "c, lbs(1).Name.Length - item2Parts(x).Length)),
  78.                                      If(item3Parts.Count <= x, String.Empty,
  79.                                         item3Parts(x) & New String(" "c, lbs(2).Name.Length - item3Parts(x).Length)),
  80.                                      If(item4Parts.Count <= x, String.Empty,
  81.                                         item4Parts(x) & New String(" "c, lbs(3).Name.Length - item4Parts(x).Length))))
  82.                Next
  83.  
  84.            Else
  85.                ' Write simgle items row.
  86.                sb.AppendLine(String.Format("{1}{0}{2}{0}{3}{0}{4}",
  87.                                  New String(" "c, spacing),
  88.                                  If(lbs(0).Items.Count <= index,
  89.                                     String.Empty & New String(" "c, lbs(0).Name.Length),
  90.                                     item1Parts.First & New String(" "c, lbs(0).Name.Length - item1Parts.First.Length)),
  91.                                  If(lbs(1).Items.Count <= index,
  92.                                     String.Empty & New String(" "c, lbs(1).Name.Length),
  93.                                     item2Parts.First & New String(" "c, lbs(1).Name.Length - item2Parts.First.Length)),
  94.                                  If(lbs(2).Items.Count <= index,
  95.                                     String.Empty & New String(" "c, lbs(2).Name.Length),
  96.                                     item3Parts.First & New String(" "c, lbs(2).Name.Length - item3Parts.First.Length)),
  97.                                  If(lbs(3).Items.Count <= index,
  98.                                     String.Empty & New String(" "c, lbs(3).Name.Length),
  99.                                     item4Parts.First & New String(" "c, lbs(3).Name.Length - item4Parts.First.Length))))
  100.  
  101.            End If
  102.  
  103.            ' Write horizontal grid.
  104.            sb.AppendLine(String.Format("{1}{0}{2}{0}{3}{0}{4}",
  105.                          New String(" "c, spacing),
  106.                          New String("-"c, lbs(0).Name.Length),
  107.                          New String("-"c, lbs(1).Name.Length),
  108.                          New String("-"c, lbs(2).Name.Length),
  109.                          New String("-"c, lbs(3).Name.Length)))
  110.  
  111.        Next index
  112.  
  113.        File.WriteAllText(filaPath, sb.ToString, Encoding.Default)
  114.        sb.Clear()
  115.        Process.Start(filaPath)
  116.  
  117.    End Sub
  118.  
  119.    ' Split By Length
  120.    ' By Elektro
  121.    '
  122.    ''' <summary>
  123.    ''' Splits a string by the specified character length.
  124.    ''' </summary>
  125.    ''' <param name="str">The string to split.</param>
  126.    ''' <param name="length">The character length.</param>
  127.    ''' <returns>IEnumerable(Of System.String).</returns>
  128.    Private Function SplitByLength(ByVal str As String,
  129.                                   ByVal length As Integer) As IEnumerable(Of String)
  130.  
  131.        Dim stringParts As New List(Of String)
  132.  
  133.        If str.Length > length Then
  134.  
  135.            Do Until str.Length <= length
  136.                stringParts.Add(str.Substring(0, length))
  137.                str = str.Remove(0, length)
  138.            Loop
  139.  
  140.            ' Add the last missing part (if any).
  141.            If Not String.IsNullOrEmpty(str) Then
  142.                stringParts.Add(str)
  143.            End If
  144.  
  145.        Else
  146.            stringParts.Add(str)
  147.  
  148.        End If
  149.  
  150.        Return stringParts
  151.  
  152.    End Function
  153.  
  154. End Class
5844  Foros Generales / Sugerencias y dudas sobre el Foro / Re: Fuente del logo en: 4 Febrero 2015, 16:34 pm
Está chulo, la verdad, me gusta ese azul marino con las letras para personalizar el escritorio de una máquina virtual.
5845  Programación / Scripting / Re: Eliminar lineas que no cumplan cierta condición en: 4 Febrero 2015, 15:53 pm
Si.. por ese lado lo estaba buscando.. pero la flag /V realiza la tarea inversa a lo que necesito..

Perdón, lo entendí al revés.

Simplemente no escribas el parámetro /V y así obtendrás el resultado contrario.

Citar
lote ctdo | 11/11/14 | 16 Cupones | 6.304,95 | 94,57 |
lote ctdo | 12/11/14 | 11 Cupones | 3.029,72 | 45,44 |
lote ctdo | 13/11/14 | 13 Cupones | 1.832,47 | 27,50 |



Código:
(Type "file.txt" | Findstr /V "^*")>"outputFile.txt"

El comando FindStr utiliza patrones de expresiones regulares, en todo caso sería "^.*", pero la expresión que debes utilizar te la indiqué en el otro comentario.

Lee sobre el uso de expresiones regulares (RegEx): http://en.wikipedia.org/wiki/Regular_expression

Saludos
5846  Foros Generales / Sugerencias y dudas sobre el Foro / Re: Fuente del logo en: 4 Febrero 2015, 15:46 pm
Porque en el logo de la pagina hay una... estrella ninja?  :xD

¿No es obvio?, porque los miembros del staff de elhacker.net son Ninjas:



...Aparte de brujos, y aprendices de brujo experimentados en las artes oscuras.

Saludos! :P
5847  Programación / .NET (C#, VB.NET, ASP) / Re: Problemas a listar Archivos en: 4 Febrero 2015, 15:24 pm
No crea el directorio con ese caracter y tambien lo de si existe esa ruta tampoco funciona(supongo que debe ser por ese caracter).

En mi caso si que me crea correctamente la carpeta con dicho caracter, no se me ocurre porque motivo a ti no funciona. ¿la instrucción no lanza ninguna excepción?, en caso afirmativo, ¿cual es el mensaje de error y el stack trace?.



Asi me funciona, si sigo estoy equivocado corrigeme

Hombre, un bloque try/catch anidado dentro de un bloque finally no es muy buena idea, el bloque finally contiene el código que será evaluado en todas las condiciones ocurra o no ocurra una excepción, puedes utilizarlo como un "On Error Resume Next", pero el bloque finally no se suele usar con la finalidad que le estás dando, sino más bien para hacer una limpieza, un cleanup, por ejemplo para asegurarse de liberar los recursos usados por objetos disposables:

Código
  1. ' Un objeto disposable cualquiera.
  2. Dim obj As MemoryStream
  3.  
  4. Try
  5.    ' Instancio la class disposable.
  6.    obj = New MemoryStream
  7.    ' Intento leer un bloque de bytes en un buffer vacío, dará error.
  8.    obj.Read(New Byte() {}, 0, 1)
  9.    ' Las instrucciones de abajo no se procesarán ya que terminó la ejecución de este bloque debido al error.
  10.    obj.Flush()
  11.    obj.Close()
  12.  
  13. Catch ex As Exception
  14.    ' Controlar la excepción.
  15.    MsgBox(ex.Message)
  16.  
  17. Finally
  18.    ' Asegurarse de liberar los recursos del objeto, se haya controlado o no la excepción.
  19.    If obj IsNot Nothing Then
  20.        obj.Flush()
  21.        obj.Close()
  22.    End If
  23.  
  24. End Try

El código que has mostrado, yo lo dejaría así:
EDITO: Bueno, también debo decir que la función GetFiles como ves devuelve una colección de objetos FileInfo, si no necesitas ningún dato más que la ruta del archivo entonces se puede simplificar bastante más para evitar algunas sentencias de LINQ innecesarias.

Código
  1.        Dim folderPath As String = "G:\"
  2.        Dim sourceFolder As String = Path.Combine(folderPath, Convert.ToChar(160))
  3.        Dim destinyFolder As String = Path.Combine(folderPath, "Recuperado")
  4.        Dim fileExts As IEnumerable(Of String) = {"docx", "pptx"}
  5.        Dim fInfoCol As IEnumerable(Of FileInfo)
  6.        Dim lvItems As ListViewItem()
  7.  
  8.        Try
  9.            Directory.Move(sourceFolder, destinyFolder)
  10.        Catch ' Omito cualquier excepción.
  11.        End Try
  12.  
  13.        Try
  14.            fInfoCol = GetFiles(folderPath, fileExts, SearchOption.AllDirectories)
  15.        Catch ' Omito cualquier excepción.
  16.        End Try
  17.  
  18.        lvItems = (From fInfo As FileInfo In fInfoCol
  19.                   Select New ListViewItem(fInfo.FullName)).ToArray
  20.  
  21.        With Me.ListView1
  22.            .BeginUpdate()
  23.            .Items.AddRange(lvItems)
  24.            .EndUpdate()
  25.        End With
  26.  
  27.    ''' <summary>
  28.   ''' Retrieves the files inside a directory,
  29.   ''' containing the specified file extensions.
  30.   ''' </summary>
  31.   ''' <param name="folderPath">The directory path where to search files.</param>
  32.   ''' <param name="fileExts">The file extensions to match.</param>
  33.   ''' <param name="searchOption">The searching mode.</param>
  34.   ''' <returns>IEnumerable(Of FileInfo).</returns>
  35.   Public Shared Function GetFiles(ByVal folderPath As String,
  36.                                   ByVal fileExts As IEnumerable(Of String),
  37.                                   ByVal searchOption As SearchOption) As IEnumerable(Of FileInfo)
  38.  
  39.       ' Set all the file extensions to lower-case and
  40.       ' Remove empty file extensions and
  41.       ' Remove "*" and "." chars from beginning of the file extension.
  42.       fileExts = From fileExt As String In fileExts
  43.                  Where Not String.IsNullOrEmpty(fileExt)
  44.                  Select fileExt.TrimStart({"*"c, "."c, " "c}).TrimEnd.ToLower
  45.  
  46.       Return From filePath As String In Directory.GetFiles(folderPath, "*", searchOption)
  47.              Where If(Not String.IsNullOrEmpty(Path.GetExtension(filePath)),
  48.                       fileExts.Contains(Path.GetExtension(filePath).TrimStart("."c).ToLower),
  49.                       Nothing)
  50.              Select New FileInfo(filePath)
  51.  
  52.   End Function

saludos
5848  Programación / Scripting / Re: Eliminar lineas que no cumplan cierta condición en: 4 Febrero 2015, 14:37 pm
Código
  1. (Type "file.txt" | Findstr /V "^lote ^vta")>"outputFile.txt"

Saludos
5849  Foros Generales / Sugerencias y dudas sobre el Foro / Re: Fuente del logo en: 4 Febrero 2015, 14:19 pm
Hemi Head 426
http://fontzone.net/font-details/hemi-head-426

Saludos!
5850  Programación / .NET (C#, VB.NET, ASP) / Re: Problemas a listar Archivos en: 4 Febrero 2015, 02:44 am
Código
  1. Shell("cmd.exe /c move /-y " & """" & "G:\" & ChrW(&HA0) & """" & " G:\Recuperado")

Buf...! Queda totalmente prohibido a partir de hoy utilizar Batch bajo .Net en este foro.

No, en serio, no utilices herramientas primitivas como la consola de Windows + comandos de Batch, es innecesario y no te aporta ningún control sobre dicha acción, prueba así:

Código
  1. Imports System.IO

Código
  1. Dim sourceFolder As String = Path.Combine("C:\", Convert.ToChar(160))
  2. Dim destinyFolder As String = Path.Combine("C:\", "Recuperado")
  3.  
  4. Try
  5.    Directory.CreateDirectory(sourceFolder) ' Creo la carpeta para reproducir el problema que has descrito.
  6.  
  7.    If Directory.Exists(sourceFolder) Then ' Si el directorio existe...
  8.        ' Lo muevo.
  9.        Directory.Move(sourceFolder, destinyFolder)
  10.    End If
  11.  
  12. Catch ex As Exception
  13.    Throw
  14.  
  15. End Try

saludos
Páginas: 1 ... 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 [585] 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 ... 1236
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines