Assalamuallaikum...sob..
Kali ini saya akan memberi SC untuk belajar membuat SSH Multi Log Server, Untuk yang mau nyoba silahkan
copy SC'y di bawah ga perlu download tinggal atur sediri da oprek, Penampilan'y kurang lebih seperti gambar di
bawah.
Ok silahkan copy SC'y dan kreasikan sendiri
1. Pertama masukan code ini di bawah {$r * dfm}
{$R *.dfm}
function
KillTask(ExeFileName: string):Integer;
const PROCESS_TERMINATE = $0001;
var ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin Result := 0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while Integer(ContinueLoop) <> 0 do begin if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) = UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) = UpperCase(ExeFileName))) then
Result := Integer(TerminateProcess( OpenProcess(PROCESS_TERMINATE, BOOL(0), FProcessEntry32.th32ProcessID), 0));
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
1. Masukan di Button Login
procedure TForm1.Button1Click(Sender: TObject);
var
HostSSH,PortSSH,UserSSH,PassSSH,HostSSH1,PortSSH1,UserSSH1,PassSSH1,HostSSH2,PortSSH2,UserSSH2,PassSSH2,ProxySSH,lportSSH,loginSSH,loginSSH1,loginSSH2,ptype,Bitvise,akunSSH1,akunSSH2,akunSSH3,akunSSH4:String;
begin
UserSSH:= edit1.Text;
PassSSH:= edit2.Text;
HostSSH:= edit3.Text;
PortSSH:= edit4.Text;
HostSSH1:= edit10.Text;
PortSSH1:= edit11.Text;
UserSSH1:= edit8.Text;
PassSSH1:= edit9.Text;
ProxySSH:= edit5.Text;
lportSSH:= edit6.Text;
ptype := edit7.Text;
begin
edit1.Enabled := False;
edit2.Enabled := False;
edit3.Enabled := False;
edit4.Enabled := False;
edit8.Enabled := False;
edit9.Enabled := False;
edit10.Enabled := False;
edit11.Enabled := False;
if Checkbox1.Checked then
begin
Edit5.Enabled := False;
edit6.Enabled := False;
Edit7.Enabled := False;
loginSSH:=' -host='+HostSSH+' -port='+PortSSH+' -loginOnStartup'+ ' -username='+UserSSH+' -password='+PassSSH+' -proxy=y -proxyType='+ptype+' -ProxyServer='+ProxySSH+' -ProxyPort='+lportSSH+' -menu=small';
loginSSH1:=' -host='+HostSSH1+' -port='+PortSSH1+' -loginOnStartup'+ ' -username='+UserSSH1+' -password='+PassSSH1+' -proxy=y -proxyType='+ptype+' -ProxyServer='+ProxySSH+' -ProxyPort='+lportSSH+' -menu=small';
loginSSH2:=' -host='+HostSSH2+' -port='+PortSSH2+' -loginOnStartup'+ ' -username='+UserSSH2+' -password='+PassSSH2+' -proxy=y -proxyType='+ptype+' -ProxyServer='+ProxySSH+' -ProxyPort='+lportSSH+' -menu=small';
end;
if RadioButton1.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
end
else
if RadioButton2.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
akunSSH2:=' -profile=Bitvise\1081.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
end
else
if RadioButton3.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
akunSSH2:=' -profile=Bitvise\1081.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
akunSSH3:=' -profile=Bitvise\1082.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
end
else
if RadioButton4.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
akunSSH2:=' -profile=Bitvise\1081.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
akunSSH3:=' -profile=Bitvise\1082.bscp'+loginSSH1;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH3),nil,sw_hide);
akunSSH4:=' -profile=Bitvise\1083.bscp'+loginSSH1;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH4),nil,sw_hide);
end
else
if RadioButton1.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\1Akun.ppx silent-load'),NIL,SW_HIDE);
end
else
if RadioButton2.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\2Akun.ppx silent-load'),NIL,SW_HIDE);
end
else
if RadioButton3.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\3Akun.ppx silent-load'),NIL,SW_HIDE);
end
else
if RadioButton4.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\4Akun.ppx silent-load'),NIL,SW_HIDE);
end;
end;
3. Masukan di Button Logout Button2
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Enabled := True;
edit2.Enabled := True;
edit3.Enabled := True;
edit4.Enabled := True;
Edit8.Enabled := True;
edit9.Enabled := True;
edit10.Enabled := True;
edit11.Enabled := True;
if CheckBox1.Checked then
begin
Edit7.Enabled := True;
edit5.Enabled := True;
edit6.Enabled := True;
end;
killtask('BvSSH.exe');
killtask('Proxifier.exe');
end;
4. Klik form 1 kali masukan ini
procedure TForm1.S1Click(Sender: TObject);
var
MyIni: Tinifile;
namafile : string;
begin
with SaveDialog1 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='|*.ssh';
end;
if SaveDialog1.Execute then begin
namafile := SaveDialog1.FileName;
if Pos('.Config',namafile) = 0 then namafile := namafile + '.ssh';
myINI := TINIFile.Create(namafile);
Myini.WriteString('Configurations', 'Host', edit3.Text);
Myini.WriteString('Configurations', 'Port', edit4.Text);
myini.WriteString('Configurations', 'Username', edit1.Text);
myini.WriteString('Configurations', 'Password', edit2.Text);
myini.WriteString('Configurations', 'proxyport', edit6.Text);
myINI.Free;
end;
end;
procedure TForm1.S2Click(Sender: TObject);
var
MyIni: Tinifile;
namafile : string;
begin
with SaveDialog2 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='|*.ssh';
end;
if SaveDialog2.Execute then begin
namafile := SaveDialog2.FileName;
if Pos('.Config',namafile) = 0 then namafile := namafile + '.ssh';
myINI := TINIFile.Create(namafile);
Myini.WriteString('Configurations', 'Host', edit10.Text);
Myini.WriteString('Configurations', 'Port', edit11.Text);
myini.WriteString('Configurations', 'Username', edit8.Text);
myini.WriteString('Configurations', 'Password', edit9.Text);
myini.WriteString('Configurations', 'proxyport', edit6.Text);
myINI.Free;
end;
end;
procedure TForm1.L2Click(Sender: TObject);
var myINI : TINIFile;
namafile : string;
begin
with OpenDialog1 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='*|*.ssh';
end;
if OpenDialog1.Execute then begin
namafile := OpenDialog1.FileName;
myINI := TINIFile.Create(namafile);
edit3.Text:=Myini.ReadString('Configurations', 'Host', edit3.Text);
edit4.Text:=Myini.ReadString('Configurations', 'Port', edit4.Text);
edit1.Text:=myini.ReadString('Configurations', 'Username', edit1.Text);
edit2.Text:=myini.ReadString('Configurations', 'Password', edit2.Text);
edit6.Text:=myini.ReadString('Configurations', 'Proxyport', edit6.Text);
myINI.Free;
end;
end;
procedure TForm1.L3Click(Sender: TObject);
var myINI : TINIFile;
namafile : string;
begin
with OpenDialog2 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='*|*.ssh';
end;
if OpenDialog2.Execute then begin
namafile := OpenDialog2.FileName;
myINI := TINIFile.Create(namafile);
edit10.Text:=Myini.ReadString('Configurations', 'Host', edit10.Text);
edit11.Text:=Myini.ReadString('Configurations', 'Port', edit11.Text);
edit8.Text:=myini.ReadString('Configurations', 'Username', edit8.Text);
edit9.Text:=myini.ReadString('Configurations', 'Password', edit9.Text);
edit6.Text:=myini.ReadString('Configurations', 'Proxyport', edit6.Text);
myINI.Free;
end;
end;
end.
Kurang lebih seperti itu selanjutnya selamt berkreasi da mencoba semoga sukses dan bermanfaat..
====================================================================================
Kali ini saya akan memberi SC untuk belajar membuat SSH Multi Log Server, Untuk yang mau nyoba silahkan
copy SC'y di bawah ga perlu download tinggal atur sediri da oprek, Penampilan'y kurang lebih seperti gambar di
bawah.
Ok silahkan copy SC'y dan kreasikan sendiri
1. Pertama masukan code ini di bawah {$r * dfm}
{$R *.dfm}
function
KillTask(ExeFileName: string):Integer;
const PROCESS_TERMINATE = $0001;
var ContinueLoop: BOOL;
FSnapshotHandle: THandle;
FProcessEntry32: TProcessEntry32;
begin Result := 0;
FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
FProcessEntry32.dwSize := SizeOf(FProcessEntry32);
ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);
while Integer(ContinueLoop) <> 0 do begin if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) = UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) = UpperCase(ExeFileName))) then
Result := Integer(TerminateProcess( OpenProcess(PROCESS_TERMINATE, BOOL(0), FProcessEntry32.th32ProcessID), 0));
ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);
end;
CloseHandle(FSnapshotHandle);
end;
1. Masukan di Button Login
procedure TForm1.Button1Click(Sender: TObject);
var
HostSSH,PortSSH,UserSSH,PassSSH,HostSSH1,PortSSH1,UserSSH1,PassSSH1,HostSSH2,PortSSH2,UserSSH2,PassSSH2,ProxySSH,lportSSH,loginSSH,loginSSH1,loginSSH2,ptype,Bitvise,akunSSH1,akunSSH2,akunSSH3,akunSSH4:String;
begin
UserSSH:= edit1.Text;
PassSSH:= edit2.Text;
HostSSH:= edit3.Text;
PortSSH:= edit4.Text;
HostSSH1:= edit10.Text;
PortSSH1:= edit11.Text;
UserSSH1:= edit8.Text;
PassSSH1:= edit9.Text;
ProxySSH:= edit5.Text;
lportSSH:= edit6.Text;
ptype := edit7.Text;
begin
edit1.Enabled := False;
edit2.Enabled := False;
edit3.Enabled := False;
edit4.Enabled := False;
edit8.Enabled := False;
edit9.Enabled := False;
edit10.Enabled := False;
edit11.Enabled := False;
if Checkbox1.Checked then
begin
Edit5.Enabled := False;
edit6.Enabled := False;
Edit7.Enabled := False;
loginSSH:=' -host='+HostSSH+' -port='+PortSSH+' -loginOnStartup'+ ' -username='+UserSSH+' -password='+PassSSH+' -proxy=y -proxyType='+ptype+' -ProxyServer='+ProxySSH+' -ProxyPort='+lportSSH+' -menu=small';
loginSSH1:=' -host='+HostSSH1+' -port='+PortSSH1+' -loginOnStartup'+ ' -username='+UserSSH1+' -password='+PassSSH1+' -proxy=y -proxyType='+ptype+' -ProxyServer='+ProxySSH+' -ProxyPort='+lportSSH+' -menu=small';
loginSSH2:=' -host='+HostSSH2+' -port='+PortSSH2+' -loginOnStartup'+ ' -username='+UserSSH2+' -password='+PassSSH2+' -proxy=y -proxyType='+ptype+' -ProxyServer='+ProxySSH+' -ProxyPort='+lportSSH+' -menu=small';
end;
if RadioButton1.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
end
else
if RadioButton2.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
akunSSH2:=' -profile=Bitvise\1081.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
end
else
if RadioButton3.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
akunSSH2:=' -profile=Bitvise\1081.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
akunSSH3:=' -profile=Bitvise\1082.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
end
else
if RadioButton4.Checked then begin
Bitvise:='Bitvise\BvSSh.exe';
akunSSH1:=' -profile=Bitvise\1080.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH1),nil,sw_hide);
akunSSH2:=' -profile=Bitvise\1081.bscp'+loginSSH;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH2),nil,sw_hide);
akunSSH3:=' -profile=Bitvise\1082.bscp'+loginSSH1;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH3),nil,sw_hide);
akunSSH4:=' -profile=Bitvise\1083.bscp'+loginSSH1;
shellexecute(handle,'open',pchar(Bitvise),pchar(akunSSH4),nil,sw_hide);
end
else
if RadioButton1.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\1Akun.ppx silent-load'),NIL,SW_HIDE);
end
else
if RadioButton2.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\2Akun.ppx silent-load'),NIL,SW_HIDE);
end
else
if RadioButton3.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\3Akun.ppx silent-load'),NIL,SW_HIDE);
end
else
if RadioButton4.Checked then
begin
shellexecute(handle,'open',PChar('Proxifier\Proxifier.exe'),PChar(' Proxifier\Profiles\4Akun.ppx silent-load'),NIL,SW_HIDE);
end;
end;
3. Masukan di Button Logout Button2
procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Enabled := True;
edit2.Enabled := True;
edit3.Enabled := True;
edit4.Enabled := True;
Edit8.Enabled := True;
edit9.Enabled := True;
edit10.Enabled := True;
edit11.Enabled := True;
if CheckBox1.Checked then
begin
Edit7.Enabled := True;
edit5.Enabled := True;
edit6.Enabled := True;
end;
killtask('BvSSH.exe');
killtask('Proxifier.exe');
end;
4. Klik form 1 kali masukan ini
procedure TForm1.S1Click(Sender: TObject);
var
MyIni: Tinifile;
namafile : string;
begin
with SaveDialog1 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='|*.ssh';
end;
if SaveDialog1.Execute then begin
namafile := SaveDialog1.FileName;
if Pos('.Config',namafile) = 0 then namafile := namafile + '.ssh';
myINI := TINIFile.Create(namafile);
Myini.WriteString('Configurations', 'Host', edit3.Text);
Myini.WriteString('Configurations', 'Port', edit4.Text);
myini.WriteString('Configurations', 'Username', edit1.Text);
myini.WriteString('Configurations', 'Password', edit2.Text);
myini.WriteString('Configurations', 'proxyport', edit6.Text);
myINI.Free;
end;
end;
procedure TForm1.S2Click(Sender: TObject);
var
MyIni: Tinifile;
namafile : string;
begin
with SaveDialog2 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='|*.ssh';
end;
if SaveDialog2.Execute then begin
namafile := SaveDialog2.FileName;
if Pos('.Config',namafile) = 0 then namafile := namafile + '.ssh';
myINI := TINIFile.Create(namafile);
Myini.WriteString('Configurations', 'Host', edit10.Text);
Myini.WriteString('Configurations', 'Port', edit11.Text);
myini.WriteString('Configurations', 'Username', edit8.Text);
myini.WriteString('Configurations', 'Password', edit9.Text);
myini.WriteString('Configurations', 'proxyport', edit6.Text);
myINI.Free;
end;
end;
procedure TForm1.L2Click(Sender: TObject);
var myINI : TINIFile;
namafile : string;
begin
with OpenDialog1 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='*|*.ssh';
end;
if OpenDialog1.Execute then begin
namafile := OpenDialog1.FileName;
myINI := TINIFile.Create(namafile);
edit3.Text:=Myini.ReadString('Configurations', 'Host', edit3.Text);
edit4.Text:=Myini.ReadString('Configurations', 'Port', edit4.Text);
edit1.Text:=myini.ReadString('Configurations', 'Username', edit1.Text);
edit2.Text:=myini.ReadString('Configurations', 'Password', edit2.Text);
edit6.Text:=myini.ReadString('Configurations', 'Proxyport', edit6.Text);
myINI.Free;
end;
end;
procedure TForm1.L3Click(Sender: TObject);
var myINI : TINIFile;
namafile : string;
begin
with OpenDialog2 do begin
InitialDir:=ExtractFilePath(Application.ExeName);
Filter:='*|*.ssh';
end;
if OpenDialog2.Execute then begin
namafile := OpenDialog2.FileName;
myINI := TINIFile.Create(namafile);
edit10.Text:=Myini.ReadString('Configurations', 'Host', edit10.Text);
edit11.Text:=Myini.ReadString('Configurations', 'Port', edit11.Text);
edit8.Text:=myini.ReadString('Configurations', 'Username', edit8.Text);
edit9.Text:=myini.ReadString('Configurations', 'Password', edit9.Text);
edit6.Text:=myini.ReadString('Configurations', 'Proxyport', edit6.Text);
myINI.Free;
end;
end;
end.
Kurang lebih seperti itu selanjutnya selamt berkreasi da mencoba semoga sukses dan bermanfaat..
====================================================================================
