Lo bueno es que ahora eso ya no va a pasar mas
Todo se aprende
Saludos

Saludos
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: Keyen Night en 4 Marzo 2010, 14:30 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
Private Const BM_CLICK = &HF5
<System.Runtime.InteropServices.DllImport("user32.DLL")> _
Public Function SendMessage( _
ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As Integer _
) As Integer
End Function
<System.Runtime.InteropServices.DllImport("user32.DLL")> _
Public Function SendMessage( _
ByVal hWnd As System.IntPtr, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As String _
) As Integer
End Function
<System.Runtime.InteropServices.DllImport("user32.dll", _
EntryPoint:="FindWindow")> _
Public Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Public Function EnumChildWindows(ByVal hWndParent As System.IntPtr, ByVal lpEnumFunc As EnumWindowsProc, ByVal lParam As Integer) As Boolean
End Function
Public Function GetChildWindows(ByVal ParentHandle As IntPtr) As IntPtr()
Dim ChildrenList As New List(Of IntPtr)
Dim ListHandle As GCHandle = GCHandle.Alloc(ChildrenList)
Try
EnumChildWindows(ParentHandle, AddressOf EnumWindow, GCHandle.ToIntPtr(ListHandle))
Finally
If ListHandle.IsAllocated Then ListHandle.Free()
End Try
Return ChildrenList.ToArray
End Function
Private Function EnumWindow(ByVal Handle As IntPtr, ByVal Parameter As IntPtr) As Boolean
Dim ChildrenList As List(Of IntPtr) = GCHandle.FromIntPtr(Parameter).Target
If ChildrenList Is Nothing Then Throw New Exception("GCHandle Target could not be cast as List(Of IntPtr)")
ChildrenList.Add(Handle)
Return True
End Function
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Public Sub GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer)
' Leave function empty
End Sub
ListView1.SelectedItems
ListView1.SelectedItems(0)
ListView1.SelectedItems(0).Text
Public Shared Function Serialize(ByVal Obj As Object, ByVal AsByte As Boolean) As Byte()
Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim ms As New IO.MemoryStream
bf.Serialize(ms, Obj)
Return ms.ToArray
End Function
Public Shared Function Deserialize(ByVal Obj As Byte()) As Object
Dim bf As New Runtime.Serialization.Formatters.Binary.BinaryFormatter
Dim ms As New IO.MemoryStream(Obj)
Return bf.Deserialize(ms)
End Function
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
For i = 1 To 4
DataGridView1.Columns.Add("Col " & i, "Col " & i)
Next
For i = 1 To 10
DataGridView1.Rows.Add("Row 1-" & i, "Row 2-" & i, "Row 3-" & i, "Row 4-" & i)
Next
End Sub
Private Sub DataGridView1_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEndEdit
If DataGridView1.Item(e.ColumnIndex, e.RowIndex).Value = "" Then
DataGridView1.Item(e.ColumnIndex, e.RowIndex).ReadOnly = True
End If
End Sub
Dim fs As New FileStream("c:\op.txt", FileMode.Open)
'Bloquear
fs.Lock(0, fs.Length)
'Desbloquear
fs.Unlock(0, fs.Length)
string a="PEPE02";
string b="PEPE10";