Le probleme est dans la deuxieme partie:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37 procedure TMessageReceivedForm.SnoozeClick(Sender: TObject); var ApplicationPath,SnoozePath,UserName,ComputerName : String; FileName,FileContent : String; iniFile : TIniFile; rtf :TRichEdit; begin ApplicationPath := ExtractFilePath(Application.ExeName); iniFile := TIniFile.Create(ChangeFileExt(Application.ExeName,'.ini')); try SnoozePath := iniFile.ReadString('general','snoozefolder',''); finally iniFile.Free; end; if SnoozePath = '' then SnoozePath := ApplicationPath; FileName := 'snooze'; FileContent := 'text content; iniFile := TIniFile.Create(SnoozePath + FileName + '.ini'); try iniFile.WriteString('general','snooze','FileContent'); finally iniFile.Free; end; rtf.Create(self); try rtf.Lines.Add(FileContent); rtf.Lines.SaveToFile(SnoozePath + FileName + '.rtf'); finally rtf.Free; end; end;
Le fichier ini n'esxiste pas encore. quand j'ecris WritwString, d'apres ce que j'ai compris, si le fichier n'existe, pas, il sera creer automatiquement.
(Sinon- comment creer un fhichier ini?)
Le probleme c'est que je recois une erreur : ne peut pas ecrire dans fichier *.ini.
comment faire?
Le fichier rtf que j'essaie de creer a la fin ne marche pas non plus.
Merci de votre aide![/b]
Partager