home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / dos / t_clrpwd.arj / CLEARPWD.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-08-28  |  1.5 KB  |  56 lines

  1. Program RemovePhoneBookPassword;
  2.  
  3. { A small Terminate utility to remove forgotten passwords on phonebooks }
  4. { Made 1995 by Bo Bendtsen, SerWiz Comm, Free to modify and distribute  }
  5.  
  6. Type
  7.   PhoneHeadRec = Record
  8.                    Encrypted  : Boolean;
  9.                    Seed       : Longint;
  10.                    Version    : String[5];
  11.                    Comment    : String[26];
  12.                    Password   : Longint;
  13.                    Num        : Integer;
  14.                    CurMonth   : Byte;
  15.                    MonthCosts : Array[1..12] of Longint;
  16.                    PhonePos   : Integer;
  17.                    ScrPos,
  18.                    WritePos   : Byte;
  19.                    RangeStart,
  20.                    RangeStop  : Integer;
  21.                  End;
  22.  
  23. Var
  24.   PhoneFile : File;
  25.   PHead     : PhoneHeadRec;
  26.  
  27. Begin
  28.  
  29.   If Paramcount<>1 Then
  30.   Begin
  31.     WriteLn;
  32.     WriteLn('■ Terminate Phone Password clearing');
  33.     WriteLn;
  34.     WriteLn('  Syntax  : CLEARPWD phonebook');
  35.     WriteLn('  Example : CLEARPWD TERMINAT.FON');
  36.     Halt;
  37.   End;
  38.  
  39.   Assign(PhoneFile,Paramstr(1));
  40.   {$I-} Reset(PhoneFile,1); {$I+}
  41.   If IOResult=0 Then
  42.   Begin
  43.     {$I-} BlockRead(PhoneFile,PHead,Sizeof(PHead)); {$I+}
  44.     If IOResult<>0 Then WriteLn('Error in start of phonebook')
  45.     Else Begin
  46.       Phead.Password:=0;
  47.       Seek(PhoneFile,0);
  48.       BlockWrite(PhoneFile,PHead,Sizeof(PHead));
  49.       Close(PhoneFile);
  50.       WriteLn('Password cleared');
  51.     End;
  52.   End
  53.   Else WriteLn('Could not open ',Paramstr(1));
  54.  
  55. End.
  56.