Вниз
Скачать: 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.027 c
1-1095946900
wyt
2004-09-23 17:41
2004.10.10
Форма LogIn


4-1093831190
Registr
2004-08-30 05:59
2004.10.10
Получение каталога Windows в NT


8-1090305304
Алекс
2004-07-20 10:35
2004.10.10
Звуки Windows


3-1094896062
Гаврила
2004-09-11 13:47
2004.10.10
SQL-DMO ->AV


14-1095499311
VID
2004-09-18 13:21
2004.10.10
Как берут на работу в салон сотовой связи "Связной" (Москва)




   Наверх