OSDN Git Service

・書き込み時の新しい「書きこみ&クッキー」メッセージに対応
[gikonavigoeson/gikonavi.git] / NewBoard.pas
1 unit NewBoard;
2
3 interface
4
5 uses
6         Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
7         Dialogs, IdAntiFreezeBase, IdAntiFreeze, IdBaseComponent, IdComponent,
8         IdTCPConnection, IdTCPClient, IdHTTP, IDException, StdCtrls, IniFiles,
9         GikoSystem, BoardGroup;
10
11 type
12         TNewBoardItem = record
13                 FResponseCode: Integer;
14                 FContent: string;
15         end;
16
17         TNewBoardDialog = class(TForm)
18                 Label1: TLabel;
19                 MessageMemo: TMemo;
20                 UpdateButton: TButton;
21         CloseButton: TButton;
22                 Indy: TIdHTTP;
23                 IdAntiFreeze: TIdAntiFreeze;
24                 StopButton: TButton;
25         BoardURLComboBox: TComboBox;
26         Label13: TLabel;
27         EditIgnoreListsButton: TButton;
28         Label2: TLabel;
29     SakuCheckBox: TCheckBox;
30                 procedure UpdateButtonClick(Sender: TObject);
31                 procedure StopButtonClick(Sender: TObject);
32                 procedure CloseButtonClick(Sender: TObject);
33                 procedure FormCreate(Sender: TObject);
34         procedure EditIgnoreListsButtonClick(Sender: TObject);
35         procedure FormClose(Sender: TObject; var Action: TCloseAction);
36         private
37                 { Private \90é\8c¾ }
38                 IgnoreLists : TStringList;
39                 FAbort: Boolean;
40                 function BoardDownload(const URL: String): TNewBoardItem;
41                 function BoardLoardFromFile(const FilePath: String): String;
42                 function UpdateURL(s: string): boolean;
43                 procedure SetIgnoreCategory(b: boolean);
44                 procedure EditIgnoreList(Sender: TObject);
45                 procedure UpdateIgnoreList(Sender: TObject);
46         function CheckDeleteItem(ini: TMemIniFile): Boolean;
47         public
48                 { Public \90é\8c¾ }
49         class procedure InitHTTPClient(client : TIdHTTP);
50         end;
51
52 var
53         NewBoardDialog: TNewBoardDialog;
54
55
56 implementation
57
58 uses Giko, IdHeaderList, MojuUtils, GikoDataModule;
59
60 {$R *.dfm}
61
62 procedure TNewBoardDialog.UpdateButtonClick(Sender: TObject);
63 var
64         Item: TNewBoardItem;
65         URL : String;
66         protocol, host, path, document, port, bookmark: String;
67     TabURLs: TStringList;
68 begin
69         try
70                 MessageMemo.Clear;
71                 GikoSys.Setting.BoardURLSelected := BoardURLComboBox.ItemIndex + 1;
72                 FAbort := False;
73                 UpdateButton.Enabled := False;
74                 StopButton.Enabled := True;
75                 CloseButton.Enabled := False;
76                 EditIgnoreListsButton.Enabled := False;
77                 URL := BoardURLComboBox.Text;
78                 GikoSys.ParseURI(URL, protocol, host, path, document, port, bookmark);
79                 if (protocol = '') then begin
80                         Item.FContent := BoardLoardFromFile(URL);
81                 end else if (AnsiPos('http', protocol) > 0) then begin
82                         Item := BoardDownload(URL);
83                 end;
84                 StopButton.Enabled := False;
85                 if FAbort then
86                         Exit;
87                 if Item.FContent <> '' then begin
88             TabURLs := TStringList.Create;
89             try
90                 GikoDM.GetTabURLs(TabURLs);
91                         if (UpdateURL(Item.FContent)) then begin
92                                 GikoForm.ReloadBBS;
93                             end;
94                 GikoDM.OpenURLs(TabURLs);
95             finally
96                         TabURLs.Free;
97             end;
98                 end else
99                         MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ª\8e¸\94s\82µ\82Ü\82µ\82½[' + IntToStr(Item.FResponseCode) + ']');
100         finally
101                 UpdateButton.Enabled := True;
102                 StopButton.Enabled := False;
103                 CloseButton.Enabled := True;
104                 EditIgnoreListsButton.Enabled := True;
105         end;
106 end;
107
108 procedure TNewBoardDialog.StopButtonClick(Sender: TObject);
109 begin
110         FAbort := True;
111         Indy.DisconnectSocket;
112 end;
113
114 procedure TNewBoardDialog.CloseButtonClick(Sender: TObject);
115 begin
116         Close;
117 end;
118
119 function TNewBoardDialog.BoardDownload(const URL: String): TNewBoardItem;
120 var
121         Stream: TMemoryStream;
122         s: string;
123         i: Integer;
124 begin
125     InitHTTPClient( Indy );
126
127         Indy.Request.UserAgent := GikoSys.GetUserAgent;
128         Indy.Request.Referer := '';
129         Indy.Request.AcceptEncoding := 'gzip';
130
131         Indy.Request.CacheControl := 'no-cache';
132         Indy.Request.CustomHeaders.Add('Pragma: no-cache');
133
134 //      s := '';
135         Stream := TMemoryStream.Create;
136         try
137                 try
138                         MessageMemo.Lines.Add('\88È\89º\82Ì\8fê\8f\8a\82©\82ç\8eæ\93¾\82µ\82Ü\82·');
139                         //MessageMemo.Lines.Add(GikoSys.Setting.BoardURL2ch);
140                         MessageMemo.Lines.Add(URL);
141                         MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ð\8aJ\8en\82µ\82Ü\82·');
142                         IdAntiFreeze.Active := True;
143                         try
144                                 Indy.Get(URL, Stream);
145                         finally
146                                 IdAntiFreeze.Active := False;
147                         end;
148                         Result.FContent := GikoSys.GzipDecompress(Stream, Indy.Response.ContentEncoding);
149                         MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ª\8a®\97¹\82µ\82Ü\82µ\82½');
150                 except
151                         on E: EIdConnectException do begin
152                                 MessageMemo.Lines.Add('');
153                                 MessageMemo.Lines.Add('\90Ú\91±\82ª\8e¸\94s\82µ\82Ü\82µ\82½ \89ñ\90ü\82â\83v\83\8d\83L\83V\81AFW\82Ì\8fó\91Ô\82ð\92²\82×\82Ä\82­\82¾\82³\82¢');
154                                 MessageMemo.Lines.Add('FW\82ð\93ü\82ê\82Ä\82¢\82é\90l\82Í\90Ý\92è\82ð\8am\94F\82µ\82Ä\82­\82¾\82³\82¢');
155                                 MessageMemo.Lines.Add('NEC\82ÌPC\82Ì\8fê\8d\87\82ÍPC GATE\82ª\88«\82³\82ð\82µ\82Ä\82¢\82é\89Â\94\\90«\82ª\8d\82\82¢\82Å\82·');
156                                 MessageMemo.Lines.Add('Message: ' + E.Message);
157                         end;
158                         on E: Exception do begin
159                                 if FAbort then
160                                         MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ð\92\86\92f\82µ\82Ü\82µ\82½')
161                                 else begin
162                                         MessageMemo.Lines.Add('\83_\83E\83\93\83\8d\81[\83h\82ª\8e¸\94s\82µ\82Ü\82µ\82½');
163                                         MessageMemo.Lines.Add('ResponseCode: ' + IntToStr(Indy.ResponseCode));
164                                         MessageMemo.Lines.Add('Message: ' + E.Message);
165                                         MessageMemo.Lines.Add('------------------------');
166                                         for i := 0 to Indy.Response.RawHeaders.Count - 1 do begin
167                                                 s := Indy.Response.RawHeaders.Names[i];
168                                                 s := s + ': ' + Indy.Response.RawHeaders.Values[s];
169                                                 MessageMemo.Lines.Add(s);
170                                         end;
171                                         MessageMemo.Lines.Add('------------------------');
172                                 end;
173                         end;
174                 end;
175                 Result.FResponseCode := Indy.ResponseCode;
176         finally
177                 Stream.Free;
178         end;
179 end;
180
181 function TNewBoardDialog.UpdateURL(s: string): boolean;
182 var
183         i: Integer;
184         idx: Integer;
185         idx1: Integer;
186         idx2: Integer;
187         tmp: string;
188         URL: string;
189         Title: string;
190         cate: string;
191         Board: TBoard;
192         Change: Boolean;
193         Ignore: Boolean;
194         ini: TMemIniFile;
195         oldURLs : TStringList;
196         newURLs : TStringList;
197     SakuIdx: Integer;
198 begin
199         Change := False;
200         MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\83`\83F\83b\83N\82ð\8aJ\8en\82µ\82Ü\82·');
201         MessageMemo.Lines.Add('');
202         s := CustomStringReplace(s, '<B>', '<b>', true);
203         s := CustomStringReplace(s, '<BR>', '<br>', true);
204         s := CustomStringReplace(s, '</B>', '</b>', true);
205         s := CustomStringReplace(s, '<A HREF', '<a href', true);
206         s := CustomStringReplace(s, '</A', '</a', true);
207         cate := '';
208
209         oldURLs := TStringList.Create;
210         newURLs := TStringList.Create;
211
212         try
213
214                 GikoSys.ForceDirectoriesEx(GikoSys.GetConfigDir);
215                 ini := TMemIniFile.Create(GikoSys.GetBoardFileName);
216                 try
217                         //
218                         //\8dí\8f\9c\83I\83v\83V\83\87\83\93\82ª\91I\91ð\82³\82ê\82Ä\82¢\82é\8fê\8d\87\82Í\83N\83\8a\83A
219
220                         ini.Clear;
221
222                         while True do begin
223                                 idx1 := AnsiPos('<b>', s);
224                                 idx2 := AnsiPos('<a', s);
225 //                              if (idx1 = 0) and (idx2 = 0) then Break;
226                                 if (idx2 = 0) then Break;   // \82à\82¤URL\82Í\82È\82¢
227
228                                 if idx1 < idx2 then begin
229                                         //<br>
230                                         idx := AnsiPos('</b>', s);
231                                         if idx = 0 then begin
232                                                 s := Copy(s, idx1 + 4, Length(s));
233                                                 continue;
234                                         end;
235                                         tmp := Copy(s, idx1, (idx - idx1) + 4);
236                                         tmp := CustomStringReplace(tmp, '<b>', '');
237                                         tmp := CustomStringReplace(tmp, '</b>', '');
238                                         Ignore := false;
239                                         for i := 0 to IgnoreLists.Count - 1 do begin
240                                                 if tmp = Trim(IgnoreLists[i]) then begin
241                                                         cate := '';
242                                                         s := Copy(s, idx + 5, Length(s));
243                                                         Ignore := True;
244                                                         break;
245                                                 end;
246                                         end;
247                                         if Ignore then
248                                                 Continue;
249                                         {
250                                         if (tmp = '\82¨\82·\82·\82ß') or
251                                                  (tmp = '\93Á\95Ê\8aé\89æ') or
252                                                  (tmp = '\82Ü\82¿\82a\82a\82r') or
253                                                  (tmp = '\83`\83\83\83b\83g') or
254                                                  (tmp = '\82¨\8aG\82©\82«') or
255                                                  (tmp = '\89^\89c\88Ä\93à') or
256                                                  (tmp = '\83c\81[\83\8b\97Þ') or
257                                                  (tmp = '\91¼\82Ì\83T\83C\83g') then begin
258                                                 cate := '';
259                                                 s := Copy(s, idx + 5, Length(s));
260                                                 Continue;
261                                         end;
262                                         }
263                                         s := Copy(s, idx + 5, Length(s));
264                                         cate := tmp;
265                                 end else begin
266                                         //<a href=
267                                         if cate = '' then begin
268                                                 s := Copy(s, idx2 + 2, Length(s));
269                                         end else begin
270                                                 idx := AnsiPos('</a>', s);
271                                                 tmp := Copy(s, idx2, (idx - idx2) + 4);
272                                                 tmp := CustomStringReplace(tmp, '<a href=', '');
273                                                 tmp := CustomStringReplace(tmp, '</a>', '');
274                         tmp := CustomStringReplace(tmp, 'TARGET=_blank', '');
275                                                 i := AnsiPos('>', tmp);
276                                                 if i <> 0 then begin
277                                                         URL := Trim(Copy(tmp, 1, i - 1));
278                                                         Title := Copy(tmp, i + 1, Length(tmp));
279                             if (SakuCheckBox.Checked = True) and (Title = '\8dí\8f\9c\97v\90¿') then begin
280                                 SakuIdx := Pos('.2ch.net/saku/', URL);
281                                 if (SakuIdx > 0) then
282                                     URL := Copy(URL, 1, SakuIdx - 1) + '.2ch.net/saku2ch/';
283                             end;
284                             // BBSs\82ª\8bó\91Î\8dô
285                             if Length(BBSs) = 0 then begin
286                                 Board := nil;
287                             end else begin
288                                 Board := BBSs[ 0 ].FindBoardFromTitleAndCategory(cate, Title);
289                             end;
290                             if Board = nil then begin
291                                 MessageMemo.Lines.Add('\90V\94Â\92Ç\89Á\81u' + Title + '(' + URL + ')\81v');
292                                 ini.WriteString(cate, Title, URL);
293                                 Change := True;
294                             end else begin
295                                 if Board.URL <> URL then begin
296                                         MessageMemo.Lines.Add('URL\95Ï\8dX\81u' + Board.Title + '(' + URL +')\81v');
297                                     ini.WriteString(cate, Title, URL);
298                                     oldURLs.Add(Board.URL);
299                                     newURLs.Add(URL);
300                                     Change := True;
301                                 end else begin
302                                         ini.WriteString(cate, Title, URL);
303                                 end;
304                             end;
305                                                 end else begin
306                                                         s := Copy(s, idx2 + 2, Length(s));
307                                                         Continue;
308                                                 end;
309                                                 s := Copy(s, idx + 5, Length(s));
310                                         end;
311                                 end;
312                         end;
313             // \83J\83e\83S\83\8a/\94Â\82ª\8c¸\82Á\82½\82¾\82¯\82¾\82ÆChange\83t\83\89\83O\82ª\82½\82½\82È\82¢\82Æ\82«\82Ì\91Î\8dô
314             if not Change then begin
315                 Change := CheckDeleteItem(ini);
316             end;
317                 finally
318                         if Change then
319                                 ini.UpdateFile;
320                         ini.Free;
321                 end;
322                 MessageMemo.Lines.Add('');
323             if Change then begin
324             GikoForm.FavoritesURLReplace(oldURLs, newURLs);
325             GikoForm.RoundListURLReplace(oldURLs, newURLs);
326             GikoForm.TabFileURLReplace(oldURLs, newURLs);
327                         MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\83`\83F\83b\83N\82ª\8a®\97¹\82µ\82Ü\82µ\82½');
328                         MessageMemo.Lines.Add('\81u\95Â\82\82é\81v\83{\83^\83\93\82ð\89\9f\82µ\82Ä\82­\82¾\82³\82¢');
329                 end else
330                         MessageMemo.Lines.Add('\90V\94Â\81A\94ÂURL\95Ï\8dX\82Í \82 \82è\82Ü\82¹\82ñ\82Å\82µ\82½');
331     finally
332         oldURLs.Free;
333         newURLs.Free;
334         end;
335         Result := Change;
336 end;
337 //! \8dí\8f\9c\83J\83e\83S\83\8a/\94Â\83`\83F\83b\83N
338 function TNewBoardDialog.CheckDeleteItem(ini: TMemIniFile): Boolean;
339 var
340         URL: string;
341         Title: string;
342         orgini: TMemIniFile;
343     orgStrings, newStrings: TStringList;
344     i: Integer;
345 begin
346     orgini := TMemIniFile.Create(GikoSys.GetBoardFileName);
347     orgStrings := TStringList.Create;
348     newStrings := TStringList.Create;
349     try
350         ini.ReadSections(newStrings);
351         orgini.ReadSections(orgStrings);
352         if (newStrings.Count <> orgStrings.Count) then begin
353             //\83J\83e\83S\83\8a\92Ç\89Á\82Í\81A\94Â\82ª\92Ç\89Á\82É\82È\82é\82Ì\82Å\83`\83F\83b\83N\82µ\82È\82­\82Ä\82à\82¢\82¢
354             //\83J\83e\83S\83\8a\82Ì\8dí\8f\9c\83`\83F\83b\83N
355             for i := 0 to orgStrings.Count - 1 do begin
356                 if (newStrings.IndexOf(orgStrings[i]) = -1) then begin
357                     MessageMemo.Lines.Add('\83J\83e\83S\83\8a\8dí\8f\9c\81u' + orgStrings[i] + '\81v');
358                 end;
359             end;
360             Result := True;
361         end else begin
362             // \94Â\82Ì\90\94\83`\83F\83b\83N
363             ini.GetStrings(newStrings);
364             orgini.GetStrings(orgStrings);
365             if (newStrings.Count <> orgStrings.Count) then begin
366                 // \94Â\82Ì\8dí\8f\9c\83`\83F\83b\83N
367                 for i := 0 to orgStrings.Count - 1 do begin
368                     if (newStrings.IndexOf(orgStrings[i]) = -1) then begin
369                         Title := Copy(orgStrings[i], 1 , AnsiPos('=',orgStrings[i]) - 1);
370                         URL := Copy(orgStrings[i],
371                             AnsiPos('=',orgStrings[i]) + 1, Length(orgStrings[i]));
372                         MessageMemo.Lines.Add('\94Â\8dí\8f\9c\81u' + Title + '(' + URL +')\81v');
373                     end;
374                 end;
375                 Result := True;
376             end;
377         end;
378     finally
379         orgStrings.Free;
380         newStrings.Free;
381         orgini.Free;
382     end;
383 end;
384 procedure TNewBoardDialog.FormCreate(Sender: TObject);
385 var
386     CenterForm: TCustomForm;
387 begin
388     CenterForm := TCustomForm(Owner);
389     if Assigned(CenterForm) then begin
390         Left := ((CenterForm.Width - Width) div 2) + CenterForm.Left;
391         Top := ((CenterForm.Height - Height) div 2) + CenterForm.Top;
392     end else begin
393         Left := (Screen.Width - Width) div 2;
394         Top := (Screen.Height - Height) div 2;
395     end;
396
397         StopButton.Enabled := False;
398         BoardURLComboBox.Clear;
399         BoardURLComboBox.Items.AddStrings(GikoSys.Setting.BoardURLs);
400         try
401                 BoardURLComboBox.ItemIndex := GikoSys.Setting.BoardURLSelected - 1;
402         except
403                 BoardURLComboBox.ItemIndex := 0;
404         end;
405         SetIgnoreCategory(false);
406
407     SakuCheckBox.Checked := GikoSys.Setting.SakuBoard;
408 end;
409 //\94Â\8dX\90V\82Ì\8f\9c\8aO\83J\83e\83S\83\8a\83\8a\83X\83g\82Ì\93o\98^
410 {['\82¨\82·\82·\82ß', '\93Á\95Ê\8aé\89æ', '\82Ü\82¿\82a\82a\82r', '\83`\83\83\83b\83g', '\82¨\8aG\82©\82«', '\89^\89c\88Ä\93à', '\83c\81[\83\8b\97Þ', '\91¼\82Ì\83T\83C\83g']}
411 procedure TNewBoardDialog.SetIgnoreCategory(b: boolean);
412 begin
413         IgnoreLists := TStringList.Create;
414         if not( FileExists(GikoSys.Setting.GetIgnoreFileName) ) or ( b )then begin
415                 IgnoreLists.Add('\82¨\82·\82·\82ß');
416                 IgnoreLists.Add('\93Á\95Ê\8aé\89æ');
417                 IgnoreLists.Add('\82Ü\82¿\82a\82a\82r');
418                 IgnoreLists.Add('\83`\83\83\83b\83g');
419                 IgnoreLists.Add('\82¨\8aG\82©\82«');
420                 IgnoreLists.Add('\89^\89c\88Ä\93à');
421                 IgnoreLists.Add('\83c\81[\83\8b\97Þ');
422                 IgnoreLists.Add('\91¼\82Ì\83T\83C\83g');
423         end else begin
424                 try
425                         IgnoreLists.LoadFromFile(GikoSys.Setting.GetIgnoreFileName);
426                 except
427                         IgnoreLists.Free;
428                         SetIgnoreCategory(true);
429                 end;
430         end;
431 end;
432
433 procedure TNewBoardDialog.EditIgnoreListsButtonClick(Sender: TObject);
434 begin
435         EditIgnoreList(Sender);
436         EditIgnoreListsButton.OnClick := UpdateIgnoreList;
437 end;
438 procedure TNewBoardDialog.EditIgnoreList(Sender: TObject);
439 var
440         i: Integer;
441 begin
442         EditIgnoreListsButton.Caption := '\8f\9c\8aO\83J\83e\83S\83\8a\81[\8dX\90V';
443         Label2.Caption := '\8ae\82P\8ds\82É\83J\83e\83S\83\8a\96¼\82ð\8bL\93ü\82µ\82Ä\82­\82¾\82³\82¢\81B\81i\89ü\8ds\82ÍCtrl+Enter\81j';
444         UpdateButton.Enabled := false;
445         //MessageMemo.ReadOnly := false;
446         MessageMemo.Clear;
447         for i := 0 to IgnoreLists.Count - 1 do
448                 MessageMemo.Lines.Add(IgnoreLists[i]);
449 end;
450 procedure TNewBoardDialog.UpdateIgnoreList(Sender: TObject);
451 var
452         i: Integer;
453 begin
454         Label2.Caption := '';
455     UpdateButton.Enabled := true;
456         EditIgnoreListsButton.Caption := '\8f\9c\8aO\83J\83e\83S\83\8a\81[\95Ò\8fW';
457         IgnoreLists.Clear;
458         for i := 0 to MessageMemo.Lines.Count - 1 do
459                 IgnoreLists.Add(MessageMemo.Lines[i]);
460         IgnoreLists.SaveToFile(GikoSys.Setting.GetIgnoreFileName);
461         IgnoreLists.Free;
462         SetIgnoreCategory(false);
463         //MessageMemo.ReadOnly := true;
464         MessageMemo.Clear;
465         EditIgnoreListsButton.OnClick := EditIgnoreListsButtonClick;
466 end;
467
468 procedure TNewBoardDialog.FormClose(Sender: TObject;
469   var Action: TCloseAction);
470 begin
471     GikoSys.Setting.SakuBoard := SakuCheckBox.Checked;
472         IgnoreLists.Free;
473 end;
474 //! \83\8d\81[\83J\83\8b\83t\83@\83C\83\8b\82ð\83\8d\81[\83h\82·\82é
475 function TNewBoardDialog.BoardLoardFromFile(const FilePath: String): String;
476 var
477         html : TStringList;
478 begin
479         Result := '';
480         // \83t\83@\83C\83\8b\82ª\91\8dÝ\82µ\82Ä\82¢\82é\82©\83`\83F\83b\83N
481         if (FileExists(FilePath)) then begin
482                 html := TStringList.Create();
483                 try
484                         html.LoadFromFile(FilePath);
485                         Result := html.Text;
486                 finally
487                         html.Free;
488                 end;
489         end;
490 end;
491
492 class procedure TNewBoardDialog.InitHTTPClient(client : TIdHTTP);
493 begin
494         client.Request.Clear;
495     client.Request.CustomHeaders.Clear;
496         client.Request.UserAgent := GikoSys.GetUserAgent;
497         client.RecvBufferSize := Gikosys.Setting.RecvBufferSize;
498         client.ProxyParams.BasicAuthentication := False;
499         client.ReadTimeout := GikoSys.Setting.ReadTimeOut;
500     client.ConnectTimeout := GikoSys.Setting.ReadTimeOut;
501
502         if GikoSys.Setting.ReadProxy then begin
503                 if GikoSys.Setting.ProxyProtocol then
504                         client.ProtocolVersion := pv1_1
505                 else
506                         client.ProtocolVersion := pv1_0;
507                 client.ProxyParams.ProxyServer := GikoSys.Setting.ReadProxyAddress;
508                 client.ProxyParams.ProxyPort := GikoSys.Setting.ReadProxyPort;
509                 client.ProxyParams.ProxyUsername := GikoSys.Setting.ReadProxyUserID;
510                 client.ProxyParams.ProxyPassword := GikoSys.Setting.ReadProxyPassword;
511                 if GikoSys.Setting.ReadProxyUserID <> '' then
512                         client.ProxyParams.BasicAuthentication := True;
513         end else begin
514                 if GikoSys.Setting.Protocol then
515                         client.ProtocolVersion := pv1_1
516                 else
517                         client.ProtocolVersion := pv1_0;
518                 client.ProxyParams.ProxyServer := '';
519                 client.ProxyParams.ProxyPort := 80;
520                 client.ProxyParams.ProxyUsername := '';
521                 client.ProxyParams.ProxyPassword := '';
522         end;
523 end;
524 end.