Di tutorial kali ini, kita akan membuat Super ROUTE
Biar kl di tambahkan di project tool semakin joz
Apakah Route itu ? Route adalah ,....
Tanya Mbah Gugel aja dah, lebih pinter ,. wkwkw
Bagaimana Kelanjutanya Yuk, tarik mang...
Pertama2, Buka Delphi 7 nya
File- New - Application
trs kita tambahkan Dulu :
Uses = MMsystem , Winsock
Public declarations = function AddRoute: Boolean;
var = DosCommand1 : TDosCommand;
Route :String;
trs ke form nya masukan :
1. 1 Buah Memo
2. 2 Buah Groupbox
3. 2 buah timer
4. 1 doscommand
- Groupbox 1 = Command, kita isi , 1 edit text , edit kita ksh nama = printex
- 2 buah button, button 1 nama = send, button 2= clear
- Groupbox 2 = Route, kita isi, 1 combobox, 3 buah button, 3 edit
- combo kita ksh nama = proxy,
button 3 = add , button 4 = del, button 5 = btngetip
edit 1 = getip , edit2 = mask, edit3 = matric
- timer1 kita ksh nama = TimerRefresh
- timer2 kita ksh nama = TimerRoutPrint , enable = false
trs, di bawah :
implementation
{$R *.dfm}
kita masukan dulu =
procedure tahan(Time: integer);
var
TimeNow: LongInt;
begin
TimeNow := timeGetTime;
while (TimeNow + Time) > timeGetTime do
begin
Application.ProcessMessages;
end;
end;
function GetIPAddress(): string;
type
pu_long = ^u_long;
var
varTWSAData: TWSAData;
varPHostEnt: PHostEnt;
varTInAddr: TInAddr;
namebuf: array[0..255] of char;
begin
if WSAStartup($101, varTWSAData) <> 0 then
Result := ''
else begin
gethostname(namebuf, sizeof(namebuf));
varPHostEnt := gethostbyname(namebuf);
varTInAddr.S_addr := u_long(pu_long(varPHostEnt^.h_addr_list^)^);
Result := inet_ntoa(varTInAddr);
end;
WSACleanup;
end;
Function TForm1.AddRoute: Boolean;
begin
Application.ProcessMessages;
//getip.Text:= GetIPAddress;
WinExec(PChar('ROUTE DELETE 0.0.0.0'), SW_HIDE);
DosCommand1 := TDosCommand.Create(nil);
Route := 'route add '+ proxy.Text; // proxy oprator
if mask.Text <> '' then
Route := Route + ' mask ' + mask.Text;
Route := Route + ' ' + GetIPAddress;
if metric.Text <> '' then
Route := Route + ' metric ' + metric.Text;
DosCommand1.CommandLine := Route;
DosCommand1.Execute;
sMemo1.lines.add(Route+#13#10#13#10+'Route Berhasil..!');
end;
terus ke:
- Groupbox1
Button send , klik 2x, masukan :
DosCommand1 := TDosCommand.Create(nil);
route := printex.Text;
DosCommand1.CommandLine := route;
DosCommand1.OutputLines := sMemo1.Lines;
DosCommand1.Execute;
TimerRoutprint.Enabled:= True;
Button clear , klik 2x masukan :
sMemo1.Clear;
- Groupbox2
proxy = items = string , kita isikan =
Telkomsel
XL
Indosat
Axis
Three
Esia/Aha
Smart
button add, klik 2x, masukan :
sMemo1.Lines.Add('Wait...');
tahan(2000);
AddRoute;
button del , klik 2x , masukan :
WinExec(PChar('ROUTE DELETE 0.0.0.0'), SW_HIDE);
sMemo1.Lines.Add('Wait...');
tahan(2000);
sMemo1.Lines.Add('ROUTE DELETE 0.0.0.0 Sukses');
btngetip , klik 2x, masukan :
getip.Text:= GetIPAddress;
mask , isikan = 255.255.255.255
metric, isikan = 1
Timer :
Timer1 = TimerRefresh ,klik 2x , masukan :
Application.ProcessMessages;
Timer2 = TimerRoutPrint, klik 2x , masukan :
Application.ProcessMessages;
DosCommand1 := TDosCommand.Create(nil);
Route := 'route print';
DosCommand1.CommandLine := Route;
DosCommand1.OutputLines := sMemo1.Lines;
DosCommand1.Execute;
TimerRoutprint.Enabled:= False;
terakir, combobox = proxy , klik 2x, masukan :
if proxy.ItemIndex=0 then
Edit1.Text:='10.1.89.130';
if proxy.ItemIndex=1 then
Edit1.Text:='202.152.240.50';
if proxy.ItemIndex=2 then
Edit1.Text:='10.19.19.19';
if proxy.ItemIndex=3 then
Edit1.Text:='10.8.3.8';
if proxy.ItemIndex=4 then
Edit1.Text:='10.4.0.10';
if proxy.ItemIndex=5 then
Edit1.Text:='10.177.7.7';
if proxy.ItemIndex=6 then
Edit1.Text:='10.17.27.250';
kita tmbh alphaskin dl,biar manis
Kita tester dl... :D
Ok, Sudah jalan ,... Joz
Bagaimana, Mudah bukan..
Demikian cara tutorial membuat Super ROUTE ala ' The Nubitol '..
Sampai Jumpa di laen kesempatan,.
Cheerrrsss,............................
Download ROUTE

Tidak ada komentar:
Posting Komentar