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

 

 


Tema destacado: Security Series.XSS. [Cross Site Scripting]


  Mostrar Mensajes
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 29
11  Programación / .NET (C#, VB.NET, ASP) / Re: 'Microsoft.Jet.OLEDB.4' en: 5 Marzo 2010, 03:19 am
Lo bueno es que ahora eso ya no va a pasar mas ;) Todo se aprende

Saludos
12  Programación / .NET (C#, VB.NET, ASP) / Re: Esconder y Proteger archivos y/o carpetas en: 4 Marzo 2010, 15:17 pm
Yo te recomiendo usar AccessControl tanto para archivos como para carpetas mira este ejemplo de un codigo que puse hace tiempo, claro le falta que lo pulas más ya que este codigo es algo viejo y ya aprendi una forma de hacerlo mejor pero ahora no estoy en mi PC donde tengo el source xD

http://foro.elhacker.net/net/denegar_acceso_a_archivo_o_directorios_sub-t263788.0.html;msg1286242#msg1286242

Unido ha esto puedes ocultar el archivo ponerlo de solo lectura y del sistema

Esta bueno el code.
Sabes que así como esta cuando elimino el archivo me da error como es de esperarse, pero... si lo intento borrar con SHITF+DEL (borrarlo definitivamente) lo borra sin problemas :O. Sera cuestión de mirarlo

Saludos
13  Programación / .NET (C#, VB.NET, ASP) / Re: Presionar boton de un programa externo. ( VB. Net ) en: 1 Marzo 2010, 18:23 pm
Viendo por ahi creo que esta es la constante


Código
  1. Private Const BM_CLICK = &HF5
14  Programación / .NET (C#, VB.NET, ASP) / Re: Presionar boton de un programa externo. ( VB. Net ) en: 1 Marzo 2010, 16:45 pm
Para hacer eso tenes que saber el handle del botón que quieres presionar. Y enviarle con SendMessage "un click"

Acá tienes el código del SendMessage:
Código
  1.    <System.Runtime.InteropServices.DllImport("user32.DLL")> _
  2.    Public Function SendMessage( _
  3.            ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, _
  4.            ByVal wParam As Integer, ByVal lParam As Integer _
  5.            ) As Integer
  6.    End Function
  7.  
  8.    <System.Runtime.InteropServices.DllImport("user32.DLL")> _
  9. Public Function SendMessage( _
  10.        ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, _
  11.        ByVal wParam As Integer, ByVal lParam As String _
  12.        ) As Integer
  13.    End Function

Para buscar el handle del boton puedes instalarte WinID (asi sabes como buscarlo desde la aplicacion)

Seguramente te sirvan todas estas funciones:
Código
  1. <System.Runtime.InteropServices.DllImport("user32.dll", _
  2.    EntryPoint:="FindWindow")> _
  3.    Public Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
  4.    End Function
  5.  
  6.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  7.    Public Function EnumChildWindows(ByVal hWndParent As System.IntPtr, ByVal lpEnumFunc As EnumWindowsProc, ByVal lParam As Integer) As Boolean
  8.    End Function
  9.  
  10.    Public Function GetChildWindows(ByVal ParentHandle As IntPtr) As IntPtr()
  11.        Dim ChildrenList As New List(Of IntPtr)
  12.        Dim ListHandle As GCHandle = GCHandle.Alloc(ChildrenList)
  13.        Try
  14.            EnumChildWindows(ParentHandle, AddressOf EnumWindow, GCHandle.ToIntPtr(ListHandle))
  15.        Finally
  16.            If ListHandle.IsAllocated Then ListHandle.Free()
  17.        End Try
  18.        Return ChildrenList.ToArray
  19.    End Function
  20.  
  21.    Private Function EnumWindow(ByVal Handle As IntPtr, ByVal Parameter As IntPtr) As Boolean
  22.        Dim ChildrenList As List(Of IntPtr) = GCHandle.FromIntPtr(Parameter).Target
  23.        If ChildrenList Is Nothing Then Throw New Exception("GCHandle Target could not be cast as List(Of IntPtr)")
  24.        ChildrenList.Add(Handle)
  25.        Return True
  26.    End Function
  27.  
  28.    <System.Runtime.InteropServices.DllImport("user32.dll")> _
  29.    Public Sub GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer)
  30.        ' Leave function empty    
  31.    End Sub

Lo que no se es cual es la constante a enviar. Quedaría buscar por ahí

Saludos
15  Programación / .NET (C#, VB.NET, ASP) / Re: ListView me trae de cabezaaaa ( C# ) en: 27 Febrero 2010, 19:29 pm
Con esto obtenes los items seleccionados:
Código
  1. ListView1.SelectedItems

Si solo seleccionas 1, lo obtenes asi:

Código
  1. ListView1.SelectedItems(0)

Para el nombre de ese item:

Código
  1. ListView1.SelectedItems(0).Text

Y bueno, anda investigando que mas podes sacar de ahí ;)

Saludos
16  Programación / .NET (C#, VB.NET, ASP) / Re: Serializacion datatable en: 26 Febrero 2010, 20:09 pm
Código
  1. Public Shared Function Serialize(ByVal Obj As Object, ByVal AsByte As Boolean) As Byte()
  2.        Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
  3.        Dim ms As New IO.MemoryStream
  4.        bf.Serialize(ms, Obj)
  5.        Return ms.ToArray
  6. End Function
  7.  
  8. Public Shared Function Deserialize(ByVal Obj As Byte()) As Object
  9.        Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
  10.        Dim ms As New IO.MemoryStream(Obj)
  11.        Return bf.Deserialize(ms)
  12. End Function
  13.  
17  Programación / .NET (C#, VB.NET, ASP) / Re: cell readonly no funciona en: 24 Febrero 2010, 15:46 pm
Código
  1.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.        For i = 1 To 4
  3.            DataGridView1.Columns.Add("Col " & i, "Col " & i)
  4.        Next
  5.  
  6.        For i = 1 To 10
  7.            DataGridView1.Rows.Add("Row 1-" & i, "Row 2-" & i, "Row 3-" & i, "Row 4-" & i)
  8.        Next
  9.    End Sub
  10.  
  11.    Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
  12.        If DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value = "" Then
  13.            DataGridView1.Item(e.ColumnIndex, e.RowIndex).ReadOnly = True
  14.        End If
  15.    End Sub
18  Programación / .NET (C#, VB.NET, ASP) / Re: Bloquear fichero para que nadie más acceda a el en: 23 Febrero 2010, 14:58 pm
Código
  1. Dim fs As New FileStream("c:\op.txt", FileMode.Open)
  2.  
  3. 'Bloquear
  4. fs.Lock(0, fs.Length)
  5.  
  6. 'Desbloquear
  7. fs.Unlock(0, fs.Length)

Espero te sirva

Saludos
19  Programación / .NET (C#, VB.NET, ASP) / Re: Duda comparación de strings en: 22 Febrero 2010, 19:45 pm
O manejas los números como números o puedes poner:

Código
  1. string a="PEPE02";
  2. string b="PEPE10";

y listo

Saludos!
20  Programación / .NET (C#, VB.NET, ASP) / Re: [C#]Problema con Sockets + Formularios en: 22 Febrero 2010, 03:26 am
http://www.elguille.info/colabora/puntoNET/PabloTilli_SocketsVBNET.htm
Páginas: 1 [2] 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ... 29
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines