• Domingo 5 de Mayo de 2024, 12:11

Mostrar Mensajes

Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.


Mensajes - akira

Páginas: [1]
1
VB .NET / Directorios
« en: Viernes 1 de Abril de 2005, 18:13 »
lo que necesitaria hacer es cargar mas de un directorio en el tipo filesystemwatcher.path, osea que me vea los eventos en mas de un direcotio, ej. C:\TEMP y C:\PRUEBA, como hago esto?
Desde ya muchas gracias.
Saludos, aca paso el codigo donde defino eso.
Código: Text
  1.  
  2.  watchfolder = New System.IO.FileSystemWatcher
  3.  
  4.         watchfolder.Path = txt_watchpath.Text
  5.         watchfolder.IncludeSubdirectories = True
  6.         watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
  7.         watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
  8.                                    IO.NotifyFilters.FileName
  9.         watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
  10.                                    IO.NotifyFilters.Attributes
  11.  
  12.  
El txt_watchpath.text lo reemplazaria por los directorios que necesito ver.
Saludos.

2
VB .NET / Re: Pregunta, Modificacion Archivos
« en: Viernes 1 de Abril de 2005, 18:11 »
Gracias por la respuesta lo que necesitaria hacer es cargar mas de un directorio en el tipo filesystemwatcher.path, osea que me vea los eventos en mas de un direcotio, ej. C:\TEMP y C:\PRUEBA, como hago esto?
Desde ya muchas gracias.
Saludos, aca paso el codigo donde defino eso.
Código: Text
  1.  
  2.  watchfolder = New System.IO.FileSystemWatcher
  3.  
  4.         watchfolder.Path = txt_watchpath.Text
  5.         watchfolder.IncludeSubdirectories = True
  6.         watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
  7.         watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
  8.                                    IO.NotifyFilters.FileName
  9.         watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
  10.                                    IO.NotifyFilters.Attributes
  11.  
  12.  
txt_watchpath.text lo reeemplazaria por los directorios que necesito poner, eliminando la entrada de directorios manualmente.
Gracias.

3
VB .NET / Archivos .ini
« en: Martes 29 de Marzo de 2005, 16:43 »
Hola amigos/as tengo una pregunta para ud's, tengo un programa que logea cambios de archivos en un directorio, lo que me gustaria hacer, es que lea un archivo ini en el cual le pueda definir todas las variables para que verifique archivos o directorios, se que esto va a ser mas complicado, pero me gustaria que me den una mano.
Saludos.
Adjunto mi programa.
[CODE]Option Explicit On
Option Strict Off
Imports System
Imports System.IO
Imports System.Diagnostics
Imports Microsoft.VisualBasic

Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Código generado por el Diseñador de Windows Forms "

    Public Sub New()
        MyBase.New()

        'El Diseñador de Windows Forms requiere esta llamada.
        InitializeComponent()

        'Agregar cualquier inicialización después de la llamada a InitializeComponent()

    End Sub

    'Form reemplaza a Dispose para limpiar la lista de componentes.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Requerido por el Diseñador de Windows Forms
    Private components As System.ComponentModel.IContainer

    'NOTA: el Diseñador de Windows Forms requiere el siguiente procedimiento
    'Puede modificarse utilizando el Diseñador de Windows Forms.
    'No lo modifique con el editor de código.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents txt_watchpath As System.Windows.Forms.TextBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents btn_startwatch As System.Windows.Forms.Button
    Friend WithEvents btn_stop As System.Windows.Forms.Button
    Friend WithEvents txt_folderactivity As System.Windows.Forms.TextBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label
        Me.txt_watchpath = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.btn_startwatch = New System.Windows.Forms.Button
        Me.btn_stop = New System.Windows.Forms.Button
        Me.txt_folderactivity = New System.Windows.Forms.TextBox
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 40)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(152, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Ingresar Carpeta a Scannear"
        '
        'txt_watchpath
        '
        Me.txt_watchpath.Location = New System.Drawing.Point(160, 40)
        Me.txt_watchpath.Name = "txt_watchpath"
        Me.txt_watchpath.Size = New System.Drawing.Size(248, 20)
        Me.txt_watchpath.TabIndex = 1
        Me.txt_watchpath.Text = ""
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(24, 112)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(120, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "Actividad en la carpeta"
        '
        'btn_startwatch
        '
        Me.btn_startwatch.Location = New System.Drawing.Point(440, 40)
        Me.btn_startwatch.Name = "btn_startwatch"
        Me.btn_startwatch.Size = New System.Drawing.Size(120, 24)
        Me.btn_startwatch.TabIndex = 3
        Me.btn_startwatch.Text = "Empezar"
        '
        'btn_stop
        '
        Me.btn_stop.Location = New System.Drawing.Point(440, 80)
        Me.btn_stop.Name = "btn_stop"
        Me.btn_stop.Size = New System.Drawing.Size(120, 24)
        Me.btn_stop.TabIndex = 4
        Me.btn_stop.Text = "Detener"
        '
        'txt_folderactivity
        '
        Me.txt_folderactivity.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.txt_folderactivity.AutoSize = False
        Me.txt_folderactivity.Location = New System.Drawing.Point(24, 136)
        Me.txt_folderactivity.Name = "txt_folderactivity"
        Me.txt_folderactivity.Size = New System.Drawing.Size(552, 216)
        Me.txt_folderactivity.TabIndex = 5
        Me.txt_folderactivity.Text = ""
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(592, 365)
        Me.Controls.Add(Me.txt_folderactivity)
        Me.Controls.Add(Me.btn_stop)
        Me.Controls.Add(Me.btn_startwatch)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.txt_watchpath)
        Me.Controls.Add(Me.Label1)
        Me.Name = "Form1"
        Me.Text = "File Logger"
        Me.ResumeLayout(False)

    End Sub

#End Region


    Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        txt_folderactivity.Multiline = True
        txt_folderactivity.ScrollBars = ScrollBars.Vertical
    End Sub
    Public watchfolder As FileSystemWatcher
    Private Sub btn_startwatch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_startwatch.Click
        watchfolder = New System.IO.FileSystemWatcher
        watchfolder.Path = txt_watchpath.Text
        watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
        watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
                                   IO.NotifyFilters.FileName
        watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
                                   IO.NotifyFilters.Attributes

        AddHandler watchfolder.Created, AddressOf logchange
        AddHandler watchfolder.Deleted, AddressOf logchange
        AddHandler watchfolder.Renamed, AddressOf logrename
        watchfolder.EnableRaisingEvents = True

        btn_startwatch.Enabled = False
        btn_stop.Enabled = True
    End Sub
    Private Sub logchange(ByVal source As Object, ByVal e As _
                            System.IO.FileSystemEventArgs)
        Dim sr As StreamWriter
        Dim f As String = e.FullPath
        Dim arc As New System.IO.FileInfo(f)
        Dim dt As DateTime = DateTime.Now
        Const FILE_NAME As String = "C:\logbckp.txt"
        If File.Exists(FILE_NAME) = True Then
            sr = File.AppendText(FILE_NAME)
            If e.ChangeType = IO.WatcherChangeTypes.Created Then
                sr.WriteLine("El archivo  " & e.FullPath & _
                                         " ha sido creado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo  " & e.FullPath & _
                                         " ha sido creado" & vbCrLf
                sr.WriteLine("Tamaño archivo en bytes " & arc.Length & _
                            "Fecha de modificacion " & dt.ToString("d") & vbCrLf)
                txt_folderactivity.Text &= "Tamaño archivo en bytes " & arc.Length & _
                            " fecha modificacion " & dt.ToString("d") & vbCrLf
            End If
            If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
                sr.WriteLine("El archivo " & e.FullPath & _
                                        " ha sido borrado" & vbNewLine)
                txt_folderactivity.Text &= "El archivo " & e.FullPath & _
                                        " ha sido borrado" & vbNewLine
                txt_folderactivity.Text &= " fecha eliminacion " & _
                dt.ToString("d") & vbNewLine
            End If
            sr.Flush()
            sr.Close()
        End If

        If File.Exists(FILE_NAME) = False Then
            sr = File.CreateText(FILE_NAME)
            If e.ChangeType = IO.WatcherChangeTypes.Created Then
                sr.WriteLine("El archivo  " & e.FullPath & _
                                         " ha sido creado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo  " & e.FullPath & _
                                         " ha sido creado" & vbCrLf
                txt_folderactivity.Text &= "Tamaño archivo en bytes " & arc.Length & _
                " fecha modificacion " & dt.ToString("d") & vbCrLf
            End If
            If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
                sr.WriteLine("El archivo " & e.FullPath & _
                                        " ha sido borrado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo " & e.FullPath & _
                                        " ha sido borrado" & vbCrLf
                txt_folderactivity.Text &= "Tamaño archivo en bytes " & arc.Length & _
                " fecha modificacion " & dt.ToString("d") & vbCrLf
            End If
            sr.WriteLine("Tamaño archivo en bytes " & arc.Length & _
            " fecha modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
        End If

    End Sub
    Public Sub logrename(ByVal source As Object, ByVal e As _
                                System.IO.RenamedEventArgs)
        Const FILE_NAME As String = "C:\logbckp.txt"
        Dim sr As StreamWriter
        Dim f As String = e.FullPath
        Dim arc As New System.IO.FileInfo(f)
        Dim dt As DateTime = DateTime.Now
        If File.Exists(FILE_NAME) = True Then
            sr = File.AppendText(FILE_NAME)
            sr.WriteLine("El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf)
            sr.WriteLine(" tamaño archivo en bytes " & arc.Length & _
           " fecha modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
            txt_folderactivity.Text &= "El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf
            txt_folderactivity.Text &= "Tamaño archivo en bytes " & arc.Length & _
            " fecha modificacion " & dt.ToString("d") & vbCrLf
        End If
        If File.Exists(FILE_NAME) = False Then
            sr = File.CreateText(FILE_NAME)
            sr.WriteLine("El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf)
            sr.WriteLine("Tamaño archivo en bytes " & arc.Length & _
            " fecha modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
            txt_folderactivity.Text &= "El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf
            txt_folderactivity.Text &= " tamaño archivo en bytes " & arc.Length & _
                           " fecha modificacion " & dt.ToString("d") & vbCrLf
        End If
    End Sub

    Private Sub btn_stop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_stop.Click
        watchfolder.EnableRaisingEvents = False
        btn_startwatch.Enabled = True
        btn_stop.Enabled = False
    End Sub

    Private Sub txt_watchpath_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_watchpath.TextChanged

    End Sub

    Private Sub txt_folderactivity_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub txt_folderactivity_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_folderactivity.TextChanged

    End Sub
End Class



 :lightsabre:

4
VB .NET / Re: Pregunta, Modificacion Archivos
« en: Martes 29 de Marzo de 2005, 15:46 »
Tengo el siguiente problema, en el text box no me imprime los avisos uno abajo del otro.
[/CODE]
Option Explicit On
Option Strict Off
Imports System
Imports System.IO
Imports System.Diagnostics
Imports Microsoft.VisualBasic

Public Class Form1
    Inherits System.Windows.Forms.Form
   
#Region " Código generado por el Diseñador de Windows Forms "

        Public Sub New()
            MyBase.New()

            'El Diseñador de Windows Forms requiere esta llamada.
            InitializeComponent()

            'Agregar cualquier inicialización después de la llamada a InitializeComponent()

        End Sub

        'Form reemplaza a Dispose para limpiar la lista de componentes.
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing Then
                If Not (components Is Nothing) Then
                    components.Dispose()
                End If
            End If
            MyBase.Dispose(disposing)
        End Sub

        'Requerido por el Diseñador de Windows Forms
        Private components As System.ComponentModel.IContainer

        'NOTA: el Diseñador de Windows Forms requiere el siguiente procedimiento
        'Puede modificarse utilizando el Diseñador de Windows Forms.
        'No lo modifique con el editor de código.
        Friend WithEvents Label1 As System.Windows.Forms.Label
        Friend WithEvents txt_watchpath As System.Windows.Forms.TextBox
        Friend WithEvents Label2 As System.Windows.Forms.Label
        Friend WithEvents btn_startwatch As System.Windows.Forms.Button
        Friend WithEvents btn_stop As System.Windows.Forms.Button
        Friend WithEvents txt_folderactivity As System.Windows.Forms.TextBox
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label
        Me.txt_watchpath = New System.Windows.Forms.TextBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.btn_startwatch = New System.Windows.Forms.Button
        Me.btn_stop = New System.Windows.Forms.Button
        Me.txt_folderactivity = New System.Windows.Forms.TextBox
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 40)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(152, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "Ingresar Carpeta a Scannear"
        '
        'txt_watchpath
        '
        Me.txt_watchpath.Location = New System.Drawing.Point(160, 40)
        Me.txt_watchpath.Name = "txt_watchpath"
        Me.txt_watchpath.Size = New System.Drawing.Size(248, 20)
        Me.txt_watchpath.TabIndex = 1
        Me.txt_watchpath.Text = ""
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(24, 112)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(120, 16)
        Me.Label2.TabIndex = 2
        Me.Label2.Text = "Actividad en la carpeta"
        '
        'btn_startwatch
        '
        Me.btn_startwatch.Location = New System.Drawing.Point(440, 40)
        Me.btn_startwatch.Name = "btn_startwatch"
        Me.btn_startwatch.Size = New System.Drawing.Size(120, 24)
        Me.btn_startwatch.TabIndex = 3
        Me.btn_startwatch.Text = "Empezar"
        '
        'btn_stop
        '
        Me.btn_stop.Location = New System.Drawing.Point(440, 80)
        Me.btn_stop.Name = "btn_stop"
        Me.btn_stop.Size = New System.Drawing.Size(120, 24)
        Me.btn_stop.TabIndex = 4
        Me.btn_stop.Text = "Detener"
        '
        'txt_folderactivity
        '
        Me.txt_folderactivity.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.txt_folderactivity.AutoSize = False
        Me.txt_folderactivity.Location = New System.Drawing.Point(24, 136)
        Me.txt_folderactivity.Name = "txt_folderactivity"
        Me.txt_folderactivity.Size = New System.Drawing.Size(552, 216)
        Me.txt_folderactivity.TabIndex = 5
        Me.txt_folderactivity.Text = ""
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(592, 365)
        Me.Controls.Add(Me.txt_folderactivity)
        Me.Controls.Add(Me.btn_stop)
        Me.Controls.Add(Me.btn_startwatch)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.txt_watchpath)
        Me.Controls.Add(Me.Label1)
        Me.Name = "Form1"
        Me.Text = "File Logger"
        Me.ResumeLayout(False)

    End Sub

#End Region

        Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click

        End Sub

        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub
        Public watchfolder As FileSystemWatcher
        Private Sub btn_startwatch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_startwatch.Click
            watchfolder = New System.IO.FileSystemWatcher
            watchfolder.Path = txt_watchpath.Text
            watchfolder.NotifyFilter = IO.NotifyFilters.DirectoryName
            watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
                                       IO.NotifyFilters.FileName
            watchfolder.NotifyFilter = watchfolder.NotifyFilter Or _
                                       IO.NotifyFilters.Attributes

            AddHandler watchfolder.Created, AddressOf logchange
            AddHandler watchfolder.Deleted, AddressOf logchange
            AddHandler watchfolder.Renamed, AddressOf logrename
            watchfolder.EnableRaisingEvents = True

            btn_startwatch.Enabled = False
            btn_stop.Enabled = True
        End Sub
    Private Sub logchange(ByVal source As Object, ByVal e As _
                            System.IO.FileSystemEventArgs)

        Dim sr As StreamWriter
        Dim f As String = e.FullPath
        Dim arc As New System.IO.FileInfo(f)
        Dim dt As DateTime = DateTime.Now
        Const FILE_NAME As String = "C:\logbckp.txt"
        If File.Exists(FILE_NAME) = True Then
            sr = File.AppendText(FILE_NAME)
           
            If e.ChangeType = IO.WatcherChangeTypes.Created Then
                sr.WriteLine("El archivo  " & e.FullPath & _
                                         "  ha sido creado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo  " & e.FullPath & _
                                         "  ha sido creado" & vbCrLf
            End If
            If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
                sr.WriteLine("El archivo " & e.FullPath & _
                                        "   ha sido borrado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo " & e.FullPath & _
                                        "   ha sido borrado" & vbCrLf
            End If
            sr.WriteLine("tamaño archivo en bytes" & arc.Length & _
            " fecha de modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
        End If

        If File.Exists(FILE_NAME) = False Then
            sr = File.CreateText(FILE_NAME)
            If e.ChangeType = IO.WatcherChangeTypes.Created Then
                sr.WriteLine("El archivo  " & e.FullPath & _
                                         "  ha sido creado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo  " & e.FullPath & _
                                         "  ha sido creado" & vbCrLf
            End If
            If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
                sr.WriteLine("El archivo " & e.FullPath & _
                                        "   ha sido borrado" & vbCrLf)
                txt_folderactivity.Text &= "El archivo " & e.FullPath & _
                                        "   ha sido borrado" & vbCrLf
            End If
            sr.WriteLine(" tamaño archivo en bytes" & arc.Length & _
            " fecha modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
        End If
        txt_folderactivity.Text &= " tamaño archivo en bytes" & arc.Length & _
         " fecha modificacion " & dt.ToString("d") & vbCrLf
    End Sub
    Public Sub logrename(ByVal source As Object, ByVal e As _
                                System.IO.RenamedEventArgs)
        Const FILE_NAME As String = "C:\logbckp.txt"
        Dim sr As StreamWriter
        Dim f As String = e.FullPath
        Dim arc As New System.IO.FileInfo(f)
        Dim dt As DateTime = DateTime.Now
        If File.Exists(FILE_NAME) = True Then
            sr = File.AppendText(FILE_NAME)
            sr.WriteLine("El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf)
            sr.WriteLine(" tamaño archivo en bytes" & arc.Length & _
           " fecha modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
            txt_folderactivity.Text &= "El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf
            txt_folderactivity.Text &= " tamaño archivo en bytes " & arc.Length & _
            " fecha modificacion " & dt.ToString("d") & vbCrLf
        End If
        If File.Exists(FILE_NAME) = False Then
            sr = File.CreateText(FILE_NAME)
            sr.WriteLine("El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf)
            sr.WriteLine(" tamaño archivo en bytes" & arc.Length & _
            " fecha modificacion " & dt.ToString("d") & vbCrLf)
            sr.Flush()
            sr.Close()
            txt_folderactivity.Text &= "El Archivo " & e.OldName & _
            " ha sido renombrado a  " & e.Name & vbCrLf
            txt_folderactivity.Text &= " tamaño archivo en bytes " & arc.Length & _
                           " fecha modificacion " & dt.ToString("d") & vbCrLf
        End If
    End Sub

    Private Sub btn_stop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_stop.Click
        watchfolder.EnableRaisingEvents = False
        btn_startwatch.Enabled = True
        btn_stop.Enabled = False
    End Sub

    Private Sub txt_watchpath_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_watchpath.TextChanged

    End Sub

    Private Sub txt_folderactivity_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private Sub txt_folderactivity_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_folderactivity.TextChanged

    End Sub
End Class

[CODE]

5
VB .NET / Re: Pregunta, Modificacion Archivos
« en: Viernes 25 de Marzo de 2005, 07:28 »
Lo logre pude hacer una parte del codigo, el lunes voy a hacer el post, pero aun asi me quedan un par de dudas que me gustaria aclarar.
SAludos.

6
VB .NET / Re: Pregunta, Modificacion Archivos
« en: Miércoles 23 de Marzo de 2005, 13:56 »
Estamos 100% de acuerdo, yo por lo que habia leido en MSDN de esa clase no vi o por lo menos no mostraban esas dos funcionalidades que tan amablemente me comentaste.
No pretendo que nadie me mande un programa terminado que haga algo similar a lo que quiero, pero si pretendo que en la medida de lo posible me manden algun programita basico como para ver como funciona el visual basic .net ya que estoy leyendo el manual pero esta largo y nos se si terminare de leerlo.
Como te dije antes  muchas gracias por tu respuesta y vere como hago esto.
Saludos.
 :hola:

7
VB .NET / Re: Pregunta, Modificacion Archivos
« en: Martes 22 de Marzo de 2005, 18:34 »
Ok, gracias tengo entendido que la clase fileinfo es para administrar archivos (copiar, modificar, etc), lo que necesito yo es verificar la fecha y en caso de que haya sido modificada que me de un aviso.
Lo que necesitaria es si alguien me puede pasar algun codigo comoo para analizarlo y tener una idea un poco mas acabada del tema.
Saludos.
Gracias por la respuesta..
Cualquier ayuda se agradece

8
VB .NET / Pregunta, Modificacion Archivos
« en: Lunes 21 de Marzo de 2005, 18:41 »
Hola que tal soy nuevo en VB .NET, me han pedido que haga un aplicativo que chequee la fecha de un archivo para saber si ha sido modificado, cualquier ayuda sobre el tema es apreciado, ya que no tengo idea ni por donde empezar.
Saludos

9
C/C++ / Re: Impresion De Matrices
« en: Jueves 17 de Marzo de 2005, 16:59 »
Exactamente esa era mi duda, ahora el punto es como uso el goto(x,y) no tengo ni la mas minima idea de que es eso ni como se usa. Si me podrias dar un ejemplo te agradeceria... :scream:

10
C/C++ / Re: Impresion De Matrices
« en: Lunes 14 de Marzo de 2005, 19:48 »
Gracias por responder.
Te cuento lo que quiero es lo siguiente.
A mi me piden que muestre por pantalla una matriz, la cual tiene que ser recorrida en forma de espiral.
Ejemplo
 1   2  3   4
 5   6  7   8
 9  10 11 12
13 14 15 16
Esta seria la matriz que yo ingreso y  tendria que mostrarla asi
Primer elemento que muestro
1
Segundo elemento que muestro
1  2  
Tercer elemento que muestro
1  2  3
Me salteo hasta el 5 para que puedas verlo mas claro
1  2  3  4
           8
Asi tendria que aparecer el 6 elemento
1  2 3  4
          8
         12
Como podes ver la voy mostrando como si fuera un espiral de afuera hacia adentro, el tema es que tendria que mostrar los elementos con una minima pausa y que aparezcan con ese orden (de espiral). desde ya muchas gracias, te muestro lo que tengo por ahora del programa al cual le falta esto.
Saludos.
[/CODE]
#include <stdio.h>
#include <conio.h>

void cargar (int mat [][5]);

void mostrar (int mat [][5]);

void emaximo (int mat [][5]);

void multiplo (int mat [][5]);

void sumatoria (int mat [][5]);

void sumadiag (int mat[] [5]);

void ordenar (int mat[] [5]);

void main (){
    int m[5][5];
    cargar(m);
   mostrar(m);
   emaximo(m);
   multiplo(m);
   sumatoria(m);
   sumadiag(m);
   ordenar(m);
}

void cargar(int mat[][5]){
    int i,j;
    for(i=0;i<5;i++){
       for(j=0;j<5;j++){
           printf ("Ingrese Numero de Fila %d Columna %d : ",i+1,j+1);
           scanf("%d",&mat[j]);
    }
   }
}


void mostrar (int mat[][5])
{
int i,j;
   for  (i=0;i<5;i++)
   {
   printf("\n");
      for (j=0;j<5;j++)
      {
         printf("  %d",mat[j]);
      }
   }
}

void emaximo (int mat [][5])
{
int i,j,max=0,posi,posj;
   for  (i=0;i<5;i++)
   {
      for (j=0;j<5;j++)      
      {
         if ((mat[j])>max)
         {
            max=mat[j];
            posi=i;
            posj=j;
         }
         
      }
   }
printf ("\nPosicion del ultimo elemento maximo Fila:%d Columna:%d",posi+1,posj+1);
}

void multiplo (int mat[][5])
{
int i,j,mul;
   for  (i=0;i<5;i++)
   {
      for (j=0;j<5;j++)      
      {
         if ((mat[j])%5==0)
         {
            mul=mat[j];
         }
         
      }
   }
printf ("\nValor del ultimo elemento multiplo de 5:%d",mul);
}

void sumatoria (int mat[][5])
{
int i,j,resul=0;
   for (j=0;j<5;j++)
   {
      resul=resul+mat[3][j];   
   }
printf("\nSuma de la fila 3:%d",resul);
resul=0;
   for (i=0;i<5;i++)
   {
      resul=resul+mat[1];
   }
printf("\nSuma de la Columna 1:%d",resul);
}

void sumadiag (int mat[][5])
{
int i,j=0,resul=0,result=0;
   for (i=0;i<5;i++)
   {
      resul=resul+mat[j];
      j++;
   }
   printf("\nSuma de la Diagonal principal:%d",resul);
   i=4;
   for (j=0;j<5;j++)
   {      
      result=result+mat[j];      
      i--;
   }
   printf("\nSuma de la Diagonal secundaria:%d",result);
}

void ordenar (int mat[][5])
{
int i,j,aux;
   for (j=0;j<5;j++)
   {
      for (i=0;i<5;i++)
      {
         if (mat[1][j]<mat[1])
         {
            aux=mat[1][j];
            mat[1][j]=mat[1];
            mat[1]=aux;
         }
      }
   }

   printf ("\n");
   for (i=0;i<5;i++)
   {
   printf("  %d",mat[1]);
   }
   aux=0;
   for (j=0;j<5;j++)
   {
      for (i=0;i<5;i++)
      {
         if (mat[j][2]>mat[2])
         {
            aux=mat[j][2];
            mat[j][2]=mat[2];
            mat[2]=aux;
         }
      }
   }

   printf ("\n");
   for (i=0;i<5;i++)
   {
   printf("  %d",mat[2]);
   }
}
[/CODE]

11
C/C++ / Impresion De Matrices
« en: Lunes 14 de Marzo de 2005, 17:00 »
Hola a todos, desde ya gracias por el simple hecho de ponerse a leer esto.
El problema es el siguiente, me piden que imprima por pantalla una matriz recorriendola en forma de espiral y que vaya mostrando cada elemento 1 a 1 y que quede ordenada como matriz en el display.
Se como recorrerla en espiral lo que no se es como mantener el orden de la matriz por pantalla.
Gracias.
 :comp:

12
C/C++ / Re: Matrices, Vectore Y Funciones
« en: Lunes 14 de Marzo de 2005, 15:22 »
Muchas gracias por la respuesta! son lo mas!!!!!!!!!!!!!!!!!!!!!
PD. Estoy mas que agradecido. :kicking:

13
C/C++ / Re: Matrices, Vectore Y Funciones
« en: Sábado 12 de Marzo de 2005, 01:53 »
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
C:\Documents and Settings\Kafka\Mis documentos\Cpp1.cpp(4) : error C2087: '<Unknown>' : missing subscript
C:\Documents and Settings\Kafka\Mis documentos\Cpp1.cpp(9) : error C2664: 'cargar' : cannot convert parameter 1 from 'int [5][5]' to 'int [][1]'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Documents and Settings\Kafka\Mis documentos\Cpp1.cpp(12) : error C2087: '<Unknown>' : missing subscript
Error executing cl.exe.
Lo ejecute como lo reescribiste y sigue sin funcionar.. alguna idea?.
Desde ya muchisimas gracias por tomarte el tiempo de hacerlo!!!!!!!!.
Saludos a todos los que contesten ..

14
C/C++ / Matrices, Vectore Y Funciones
« en: Viernes 11 de Marzo de 2005, 20:38 »
Tengo este problema, necesito escribir un codigo para hacer una matriz, esto es lo que tengo pero no me compila estoy usando Visual C++ v6.0, si alguien me podria dar una mano estaria mas que agradecido
#Include <stdio.h>
#include <conio.h>

void cargar ( mat [][]);

void main ()
{
int m[5][5];
cargar(m);
}

void cargar(mat[][])
{
int i,j;
for (i=0;i<5;i++)
{
      for (j=0;j<5;j++)
      {
       printf ("Ingrese Numero de Fila %d  Columna %d",i,j);
       scanf("%d",&m[j]);
       }
}
}

Páginas: [1]