Вниз
Скачать: CL | DM;

Ошибка в пр-ме: ...File access denied...   Найти похожие ветки 

 
hawkins   (2004-09-21 16:06) [0]

Добрый день! Помогите решить проблему, может кто сталкивался  
с такой ошибкой. При запуске программы
вызывается исключение, текст такой:
 "... raised exception class EinOutError with message "File access denied".
Текст программы :

program MyProgramm;
uses
 Forms,Windows,SysUtils,
 Unit2 in "Unit2.pas" {Form2},
  ...
var
   F:TextFile;
  WDir:array [0..255] of char;
  FDir:string;
begin
   GetWindowsDirectory(WDir,255);
    FDir:=WDir+"\filename.txt";
    AssignFile(F,WDir);

    if not FileExists(FDir) then
      begin
       ReWrite(F);  //---- здесь ошибка-----
       CloseFile(F);
      end
     else  begin
       ...
      end;

   Application.Initialize;  
   Application.CreateForm(TForm2, Form2);
   Application.Run;
   end;

end.


 
TUser ©   (2004-09-21 16:07) [1]

FDir:=WDir+"\filename.txt";
   AssignFile(F,FDir);

   if not FileExists(FDir) then
     begin


 
TUser ©   (2004-09-21 16:08) [2]

FDir:=WDir+"\filename.txt";
   AssignFile(F,FDir);

   if not FileExists(FDir) then
     begin

+ ExcludeTrailingBackslsh для уверенности



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.024 c
14-1095775437
Cosinus
2004-09-21 18:03
2004.10.10
FAQ


1-1095860301
DelphiLexx
2004-09-22 17:38
2004.10.10
Стили окна


6-1091173191
Кириешки
2004-07-30 11:39
2004.10.10
Проблема с отправкой писем


3-1094827298
Vasis
2004-09-10 18:41
2004.10.10
Insert, Update, Delete, Refresh SQL


14-1095470112
Думкин
2004-09-18 05:15
2004.10.10
С днем рождения! 18 сентября




   Наверх