Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Internet Settings', false);
s := Reg.ReadString('ProxyServer');
//프락시 서버 설정
if Reg.ReadBool('ProxyEnable') then begin
if s <> '' then begin
idx := Pos(':', s);
if idx > 0 then begin
IdHTTP1.ProxyParams.ProxyServer := Copy(s,1,idx-1);
IdHTTP1.ProxyParams.ProxyPort := StrToIntDef(Copy(s,idx+1,Length(s)), 80);
end
else begin
IdHTTP1.ProxyParams.ProxyServer := s;
IdHTTP1.ProxyParams.ProxyPort := 8080;
end;
end;
end;
finally
Reg.Free;
end;
레지스트리값을 뒤져보니까 나오더군요..
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Internet Settings', false);
s := Reg.ReadString('ProxyServer');
//프락시 서버 설정
if Reg.ReadBool('ProxyEnable') then begin
if s <> '' then begin
idx := Pos(':', s);
if idx > 0 then begin
IdHTTP1.ProxyParams.ProxyServer := Copy(s,1,idx-1);
IdHTTP1.ProxyParams.ProxyPort := StrToIntDef(Copy(s,idx+1,Length(s)), 80);
end
else begin
IdHTTP1.ProxyParams.ProxyServer := s;
IdHTTP1.ProxyParams.ProxyPort := 8080;
end;
end;
end;
finally
Reg.Free;
end;