Bonsoir à tous et à toutes
Pour un souci de caractères, pas le mien lool j'suis un ange !!, je créé cette fonction des plus banales, le vrai but étant de gérer la création, démarrage etc... d'un service et de récupérer les erreurs :
Utilisation
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 Type TActionService= record ServiceName: String; DisplayName: String; State : TStartService; Description: String; LogFile: String; CarSource:String; CarCible :String; end; ActionService : TActionService; // ActionService.CarSource := ', '; // etc... ActionService.CarCible := 'éàè'; // etc.. //... function TFInstService.ConvAscii(Chaine:String): String; var Index,i: Integer; begin Result := ''; for i := 0 to Length(Chaine)-1 do begin Index := Pos(Chaine[i], ActionService.CarSource); if Index = 0 then Result := Result + Chaine[i] else Result := Result + ActionService.CarCible[Index]; end; // if result = '' then result := Chaine; end;
Cela me retourne systématique une chaine vide
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 function TFInstService.ReturnAction:String; Var StatusAction : TStringList; i: Integer; begin Result := ''; StatusAction := TStringList.Create; Try StatusAction.LoadFromFile(ActionService.LogFile); for i := 0 to StatusAction.Count-1 do begin if StatusAction[i] <> '' then begin Result := Result + ConvAscii(StatusAction[i]); voir(result); end; end; Finally if Assigned(StatusAction) then FreeAndNil(StatusAction); End; end;
J'ai tenté avec Char dans la fonction ConvAscii function TFInstService.ConvAscii(Key:Char): String; cela ne change rien
Genre de ligne envoyée dans le fichier log
Merci à vous.OpenService ‚chec(s) 1060
Partager