哪位好心的哥哥,帮我把下面的代码写完整好吗? ( 积分: 100 )

  • 主题发起人 主题发起人 leakboy
  • 开始时间 开始时间
L

leakboy

Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;

interface

uses
Registry,WinInet
type
TSetProxy=class
private
{ Private declarations }
procedure SetReg(FMProxy:string);
public
{ Public declarations }
Proxy: string;
port:string;
constructor Create(Proxy,Port:string);
procedure SetProxy();
// procedure SetProxy(const fProxy,fPort: string);
end;
implementation
//实际设置代理
procedure TSetProxy.SetProxy;
var FProxy: string;
Pinfo: INTERNET_PROXY_INFO;
begin
FProxy:=Format('%s:%s',[self.Proxy,self.port]);
Pinfo.dwAccessType := INTERNET_OPEN_TYPE_PROXY;
Pinfo.lpszProxy := pchar(proxy);
InternetSetOption(nil, INTERNET_OPTION_PROXY, @Pinfo, SizeOf(PInfo));
InternetSetOption(nil, INTERNET_OPTION_SETTINGS_CHANGED, nil, 0);
self.SetReg(FProxy);
end;

//SetReg负责读写注册表
procedure TSetProxy.SetReg(FMProxy:string);
var
reg: Tregistry;
begin
reg:=Tregistry.Create;
try
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Internet Settings', True) then
begin
reg.Writestring('ProxyServer', FMproxy);
reg.WriteInteger('ProxyEnable', integer(true));
end
finally
reg.CloseKey;
reg.free;
end;
end;
constructor TSetProxy.Create(Proxy,Port:string);
begin
self.Proxy:=Proxy;
self.port:=Port;
end;

end.
 
unit Unit1;

interface

uses
Registry,WinInet
type
TSetProxy=class
private
{ Private declarations }
procedure SetReg(FMProxy:string);
public
{ Public declarations }
Proxy: string;
port:string;
constructor Create(Proxy,Port:string);
procedure SetProxy();
// procedure SetProxy(const fProxy,fPort: string);
end;
implementation
//实际设置代理
procedure TSetProxy.SetProxy;
var FProxy: string;
Pinfo: INTERNET_PROXY_INFO;
begin
FProxy:=Format('%s:%s',[self.Proxy,self.port]);
Pinfo.dwAccessType := INTERNET_OPEN_TYPE_PROXY;
Pinfo.lpszProxy := pchar(proxy);
InternetSetOption(nil, INTERNET_OPTION_PROXY, @Pinfo, SizeOf(PInfo));
InternetSetOption(nil, INTERNET_OPTION_SETTINGS_CHANGED, nil, 0);
self.SetReg(FProxy);
end;

//SetReg负责读写注册表
procedure TSetProxy.SetReg(FMProxy:string);
var
reg: Tregistry;
begin
reg:=Tregistry.Create;
try
reg.RootKey := HKEY_CURRENT_USER;
if reg.OpenKey('/Software/Microsoft/Windows/CurrentVersion/Internet Settings', True) then
begin
reg.Writestring('ProxyServer', FMproxy);
reg.WriteInteger('ProxyEnable', integer(true));
end
finally
reg.CloseKey;
reg.free;
end;
end;
constructor TSetProxy.Create(Proxy,Port:string);
begin
self.Proxy:=Proxy;
self.port:=Port;
end;

end.
 
什么写完整? 你丫有病啊?
 
你想干什么?
 
真是变态
 
还是好好想想吧,不要这样,会害了你自己的,就是给你写好了你的软件后门也打开了。
 
后退
顶部