Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 16-09-2007
[Nora] [Nora] is offline
Registrado
 
Registrado: sep 2007
Posts: 2
Poder: 0
[Nora] Va por buen camino
Permisos en delphi

Hola a todos,

alguien sabe como se hace desde delphi 7 para comprobar los permisos de un fichero en windows xp?

Muchas gracias de antemano.

Un saludo!

Responder Con Cita
  #2  
Antiguo 16-09-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Poder: 25
egostar Va camino a la fama
Hola Nora, bienvenida al club.

Puedes usar esto que está en la ayuda de Delphi

Código Delphi [-]
procedure TForm1.BitBtn1Click(Sender: TObject);
var
  Attributes, NewAttributes: Word;
begin
  with FileAttrForm do
  begin
    FileDirName.Caption := FileList.Items[FileList.ItemIndex];
    { set box caption }
    PathName.Caption := FileList.Directory;
    { show directory name }
    ChangeDate.Caption := 
      DateTimeToStr(FileDateTime(FileList.FileName));
    Attributes := FileGetAttr(FileDirName.Caption);
    { read file attributes }
    ReadOnly.Checked := (Attributes and faReadOnly) = faReadOnly;
    Archive.Checked := (Attributes and faArchive) = faArchive;
    System.Checked := (Attributes and faSysFile) = faSysFile;
    Hidden.Checked := (Attributes and faHidden) = faHidden;
    if ShowModal <> id_Cancel then  { execute dialog box }
    begin
      NewAttributes := Attributes;
      { start with original attributes }
      if ReadOnly.Checked then
        NewAttributes := NewAttributes or faReadOnly
      else 
        NewAttributes := NewAttributes and not faReadOnly;
      if Archive.Checked then
        NewAttributes := NewAttributes or faArchive
      else 
        NewAttributes := NewAttributes and not faArchive;
      if System.Checked then 
        NewAttributes := NewAttributes or faSysFile
      else 
        NewAttributes := NewAttributes and not faSysFile;
      if Hidden.Checked then 
        NewAttributes := NewAttributes or faHidden
      else 
        NewAttributes := NewAttributes and not faHidden;
      if NewAttributes <> Attributes then { if anything changed... }
        FileSetAttr(FileDirName.Caption, NewAttributes);
         { ...write the new values }
    end;
  end;
end;

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita
  #3  
Antiguo 16-09-2007
[Nora] [Nora] is offline
Registrado
 
Registrado: sep 2007
Posts: 2
Poder: 0
[Nora] Va por buen camino
Perfecto. Muchas gracias egostar.

Llevaba un rato mirando por la ayuda, pero no lo daba encontrado.
No debí haber salido ayer!

Saludos!
Responder Con Cita
  #4  
Antiguo 16-09-2007
[egostar] egostar is offline
Registrado
 
Registrado: feb 2006
Posts: 6.557
Poder: 25
egostar Va camino a la fama
Cita:
Empezado por [Nora] Ver Mensaje
Perfecto. Muchas gracias egostar.

Llevaba un rato mirando por la ayuda, pero no lo daba encontrado.
No debí haber salido ayer!

Saludos!
no te preocupes, yo diría mejor, no debi ponerme a trabajar en domingo,,,,

Salud OS
__________________
"La forma de empezar es dejar de hablar y empezar a hacerlo." - Walt Disney
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Permisos de Carpeta MaMu API de Windows 2 08-05-2007 07:22:28
permisos y roles digital Firebird e Interbase 1 09-06-2006 18:19:24
permisos de red nicocer API de Windows 2 18-06-2004 20:17:46
Permisos bajo delphi asirvent API de Windows 2 03-05-2004 16:21:18


La franja horaria es GMT +2. Ahora son las 07:36:27.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi