Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TF_Dial.T1Timer(Sender: TObject);
- begin
- if sCheckBox1.Checked=True then begin
- winexec(PAnsiCHar('rasdial '+sMemo1.text),SW_HIDE);
- sLabel5.Caption:='Ditunggu GAN!! IPnya';
- Sleep(3000);
- //start winsock
- wVersionRequested := MAKEWORD(1, 1);
- WSAStartup(wVersionRequested, wsaData);
- //get computer name
- GetHostName(@stri, 128);
- phe := GetHostByName(@stri);
- //get ip address
- pc := iNet_ntoa(PInAddr(phe^.h_addr_list^)^);
- //get Hostname
- //sEdit2.Text := phe^.h_Name;
- //IP Localhost tidak akan ditampilkan
- IF pc = '127.0.0.1' then Application.ProcessMessages
- else IF pc <> '127.0.0.1' then Begin
- sListBox1.Items.Add(IntToStr(sListBox1.Count + 1) + ') ' + pc);
- end; //end else if pc
- //10.142
- //IP Match maka Online
- if sRadioButton1.Checked = True then begin
- if LeftStr(pc,6) = PAnsiCHar(sMemo2.Text) Then Begin
- T1.Enabled:=False;
- T2.Enabled:=False;
- IF pc = '127.0.0.1' then Application.ProcessMessages
- else IF pc <> '127.0.0.1' then sLabel5.Caption:=LeftStr(pc,6)+' MATCH';
- sButton2.Enabled:=False;
- End //end if
- Else if LeftStr(pc,6) <> PAnsiCHar(sMemo2.Text) Then Begin
- T1.Enabled:=False;
- T2.Enabled:=True;
- IF pc = '127.0.0.1' then Application.ProcessMessages
- else IF pc <> '127.0.0.1' then sLabel5.Caption:=LeftStr(pc,6)+' NO MATCH';
- sButton2.Enabled:=True;
- End;//end else
- end//end if .
- //182.2
- else if sRadioButton2.Checked = True then begin
- if LeftStr(pc,5) = PAnsiCHar(sMemo2.Text) Then Begin
- T1.Enabled:=False;
- T2.Enabled:=False;
- IF pc = '127.0.0.1' then Application.ProcessMessages
- else IF pc <> '127.0.0.1' then sLabel5.Caption:=LeftStr(pc,5)+' MATCH';
- sButton2.Enabled:=False;
- End //end if
- Else if LeftStr(pc,5) <> PAnsiCHar(sMemo2.Text) Then Begin
- T1.Enabled:=False;
- T2.Enabled:=True;
- IF pc = '127.0.0.1' then Application.ProcessMessages
- else IF pc <> '127.0.0.1' then sLabel5.Caption:=LeftStr(pc,5)+' NO MATCH';
- sButton2.Enabled:=True;
- End;//end else
- end;//end else 182.2
- end
- else if sCheckBox1.Checked=False then begin
- winexec(PAnsiCHar('rasdial '+sMemo1.text),SW_HIDE);
- Sleep(3000);
- //start winsock
- wVersionRequested := MAKEWORD(1, 1);
- WSAStartup(wVersionRequested, wsaData);
- //get computer name
- GetHostName(@stri, 128);
- phe := GetHostByName(@stri);
- //get ip address
- pc := iNet_ntoa(PInAddr(phe^.h_addr_list^)^);
- //get Hostname
- //sEdit2.Text := phe^.h_Name;
- //IP Localhost tidak akan ditampilkan
- IF pc = '127.0.0.1' then Application.ProcessMessages
- else IF pc <> '127.0.0.1' then Begin
- sListBox1.Items.Add(IntToStr(sListBox1.Count + 1) + ') ' + pc);
- end; //end else if pc
- sLabel5.Caption:=pc;
- //clean up winsock
- WSACleanup;
- T1.Enabled:=False;
- T2.Enabled:=False;
- sButton2.Enabled:=False;
- end;//end else
- end;
- procedure TF_Dial.T2Timer(Sender: TObject);
- begin
- winexec(PAnsiCHar('rasdial '+sMemo1.text+' /d'),SW_HIDE);
- //winexec('rasphone ',SW_HIDE);
- T2.Enabled:=False;
- T1.Enabled:=True;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement