关于INI文件的释放
procedure TDM.DBOpen;var Str_Conn:string; Str_Password,Str_DB_Name,Str_User,Str_Source:string; tempstr:string; obconfig:tinifile; Str_Path,Str_IniFile:string; Str_Temp:string; F:TextFile; Buffer:Array[0..1024]of Char; Int_Length,i:integer;begin try try UnitNo := 'Unit_DM'; tempstr:=ExtractFilePath(Application.ExeName) +'config.ini'; obconfig:=Tinifile.create(tempstr); Str_Password:= obconfig.readstring('prodpar','Password','0'); Str_DB_Name:= obconfig.readstring('prodpar','DB_Name','0'); Str_User := obconfig.readstring('prodpar','User','0'); Str_Source := obconfig.readstring('prodpar','Source','0'); Str_Conn :='Provider=SQLOLEDB.1;Password=' + Str_Password + ';Persist Security Info=false;User ID=' + Str_User; Str_Conn := Str_Conn + ';Initial Catalog=' + Str_DB_Name +';Data Source=' + Str_Source; if not conn.Connected then begin CONN.ConnectionString := Str_Conn; CONN.Open(); end; P_CHK_SelfConn := True; //Èç¹ûÁ¬½ÓÉÏ£¬ÉèÖÃΪTrue except on E:Exception do begin ShowInformation('¡¾ÏûÏ¢Êý¾Ý¿â²»ÄÜÁ¬½Ó£¬ÇëÁªÏµ¹ÜÀíÔ±¡£¡¿'); end; end; finally obconfig.Free; end;end;INI:=TINIFILE.CREATE...TRYFINALLYINI.FREEEND
[解决办法]
WINXP + delphi 7 下测试过了。
进程修改完INI后,进程不退出的情况下,INI文件可以被记事本打开修改和保存。
没有出现你说的这个问题。
[解决办法]
也可能是其它程序在使用