Arsip: aplikasi chating dengan delphi
more 19 years ago
wardmaster
minta tolong temen - temen semua adakah yang punya artikel bikin aplikasi chating dengan delphi atau situs nya, dan bagaimana ya kalau plus voice
more 19 years ago
cyber_hecker
untuk contoh aplikasi chating sederhana bisa liat di demo delphi
C:\Program Files\Borland\Delphi6\Demos\FastNet\Msg
yang ada voice-nya. gue angkat tangan dulu deh. kekekek :D
more 19 years ago
Starboard
pake jurus decompile
maksudnya, cari program yang kira kira dibuat pake delphi, trus di decompile
trus pelajari source nya. kan tambah pinter.
:o 8) :lol: :wink:
more 19 years ago
kaka-delphi
Hmmm klo misalkan tinggal pake software plus gratis, ada di kioss tuh ! nama KRAUX
more 19 years ago
Starboard
KRAUK harus masukan ip address, klo yang ip adress nya langsung ke scan, dan kita tinggal pilih lebih saik, kaya msessage pop up II, cuman code nya gak tau, itu program free, kayaknya di bangun pake delphi deh.
more 18 years ago
KucinkBatu
KRAUX...udah gw coba...keren....
coba minta aja source nya....sapa tau dikasih.huahahaha
more 18 years ago
kaka-delphi
Hubungi Boss Ulil, ntar dikasih source codenya. Tapi registrasi dulu yach ...... huahahahahhahahhhhaaaa :D :D :D
more 18 years ago
sulth4n
coba aja pelajari code ini mungkin bisa membantu
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, ScktComp;
type
Tmain = class(TForm)
Shape1: TShape;
Shape2: TShape;
Label1: TLabel;
t_ip: TEdit;
t_port: TEdit;
t_lines: TMemo;
t_send: TEdit;
lclose: TLabel;
lmin: TLabel;
lsend: TLabel;
lcon: TLabel;
ldis: TLabel;
serv: TServerSocket;
llis: TLabel;
lstop: TLabel;
lcl: TLabel;
client: TClientSocket;
tant: TEdit;
tnr: TEdit;
c1: TCheckBox;
ldisc: TLabel;
tsep: TEdit;
linfo: TLabel;
lip: TLabel;
list: TComboBox;
procedure t_sendClick(Sender: TObject);
procedure lcloseClick(Sender: TObject);
procedure lminClick(Sender: TObject);
procedure Shape2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure Label1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lcloseMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lcloseMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lminMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lminMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lsendMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lsendMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lconMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lconMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ldisMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ldisMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure llisMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure llisMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lconClick(Sender: TObject);
procedure lstopMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lstopMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure llisClick(Sender: TObject);
procedure lstopClick(Sender: TObject);
procedure ldisClick(Sender: TObject);
procedure servClientRead(Sender: TObject; Socket: TCustomWinSocket);
procedure lsendClick(Sender: TObject);
procedure t_sendKeyPress(Sender: TObject; var Key: Char);
procedure lclMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lclMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lclClick(Sender: TObject);
procedure clientConnect(Sender: TObject; Socket: TCustomWinSocket);
procedure clientDisconnect(Sender: TObject; Socket: TCustomWinSocket);
procedure clientRead(Sender: TObject; Socket: TCustomWinSocket);
procedure c1Click(Sender: TObject);
procedure ldiscMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ldiscMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure ldiscClick(Sender: TObject);
procedure linfoClick(Sender: TObject);
procedure linfoMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure linfoMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lipClick(Sender: TObject);
procedure lipMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure lipMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure listChange(Sender: TObject);
private
{ Private declarations }
procedure msg(mes:string);
procedure sendl(l:string);
public
{ Public declarations }
end;
var
main: Tmain;
implementation
uses Unit5;
{$R *.dfm}
procedure tmain.sendl(l:string);
var
nr:integer;
begin
nr:=0;
while nr<serv.Socket.ActiveConnections do begin
if serv.Socket.ActiveConnections>0 then serv.Socket.Connections[nr].SendText(l);
nr:=nr+1;
end;
end;
procedure tmain.msg(mes:string);
begin
fm.mesaj.caption:=mes;
fm.show;
end;
procedure Tmain.t_sendClick(Sender: TObject);
begin
t_send.SelectAll;
end;
procedure Tmain.lcloseClick(Sender: TObject);
begin
close;
end;
procedure Tmain.lminClick(Sender: TObject);
begin
application.Minimize;
end;
procedure Tmain.Shape2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
main.Perform(WM_Syscommand,$F012,0);
end;
procedure Tmain.Label1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
main.Perform(WM_Syscommand,$F012,0);
end;
procedure Tmain.lcloseMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lclose.Font.style:=[fsbold];
lclose.Font.color:=clwhite;
end;
procedure Tmain.lcloseMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lclose.Font.style:=[];
lclose.Font.color:=clblack;
end;
procedure Tmain.lminMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lmin.Font.style:=[fsbold];
lmin.Font.color:=clwhite;
end;
procedure Tmain.lminMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lmin.Font.style:=[];
lmin.Font.color:=clblack;
end;
procedure Tmain.lsendMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lsend.Font.style:=[fsbold];
end;
procedure Tmain.lsendMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lsend.Font.style:=[];
end;
procedure Tmain.lconMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lcon.Font.style:=[fsbold];
end;
procedure Tmain.lconMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lcon.Font.style:=[];
end;
procedure Tmain.ldisMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ldis.Font.style:=[fsbold];
end;
procedure Tmain.ldisMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ldis.Font.style:=[];
end;
procedure Tmain.llisMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
llis.Font.style:=[fsbold];
end;
procedure Tmain.llisMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
llis.Font.style:=[];
end;
procedure Tmain.lconClick(Sender: TObject);
begin
lsend.enabled:=true;
t_send.enabled:=true;
tant.enabled:=false;
llis.enabled:=false;
ldis.enabled:=true;
lcon.enabled:=false;
client.Host:=t_ip.Text;
client.Port:=strtoint(t_port.text);
client.close;
client.Open;
end;
procedure Tmain.lstopMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lstop.Font.style:=[fsbold];
end;
procedure Tmain.lstopMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lstop.Font.style:=[];
end;
procedure Tmain.llisClick(Sender: TObject);
begin
ldisc.Enabled:=true;
lcon.enabled:=false;
llis.Enabled:=false;
lstop.enabled:=true;
t_send.enabled:=true;
lsend.enabled:=true;
serv.Port:=strtoint(t_port.text);
serv.close;
serv.open;
msg('Listening !');
end;
procedure Tmain.lstopClick(Sender: TObject);
begin
ldisc.Enabled:=false;
list.Items.CommaText:='';
lcon.enabled:=true;
llis.Enabled:=true;
lstop.enabled:=false;
t_send.enabled:=false;
lsend.enabled:=false;
serv.Active:=false;
end;
procedure Tmain.ldisClick(Sender: TObject);
begin
lsend.enabled:=false;
t_send.enabled:=false;
list.Items.CommaText:='';
tant.enabled:=true;
llis.enabled:=true;
ldis.enabled:=false;
lcon.enabled:=true;
client.Socket.SendText('disconnected_'+tant.text);
client.Active:=false;
end;
procedure Tmain.servClientRead(Sender: TObject; Socket: TCustomWinSocket);
var
s,nr,me:integer;
m:string;
begin
m:=socket.ReceiveText;
t_lines.Lines.Add(m);
if copy(m,1,6)='_send_' then begin
s:=pos('_',copy(m,7,length(m)-6));
m:=copy(m,7,length(m)-6);
nr:=strtoint(copy(m,1,s-1));
m:=copy(m,s+1,length(m)-s);
serv.Socket.Connections[nr].SendText(m);
end
else if copy(m,1,10)='connected_' then begin
list.Items.Add(copy(m,11,length(m)-10));
sendl('_list_'+list.Items.CommaText);
end
else if copy(m,1,13)='disconnected_' then begin
list.Items.Delete(list.Items.IndexOf(copy(m,14,length(m)-13)));
sendl('_list_'+list.Items.CommaText);
end;
end;
procedure Tmain.lsendClick(Sender: TObject);
begin
if serv.active=true then begin
serv.Socket.Connections[strtoint(tnr.text)].SendText(tant.text+tsep.text+t_send.text);
t_lines.Lines.Add(tant.text+tsep.text+t_send.text);
end
else begin
if c1.Checked=false then client.Socket.SendText(tant.text+tsep.text+t_send.text)
else client.Socket.SendText('_send_'+tnr.Text+'_'+tant.text+tsep.text+t_send.text);
t_lines.Lines.Add(tant.text+tsep.text+t_send.text);
end;
end;
procedure Tmain.t_sendKeyPress(Sender: TObject; var Key: Char);
begin
if serv.active=true then begin
if key=chr(13) then begin
serv.Socket.Connections[strtoint(tnr.text)].SendText(tant.text+tsep.text+t_send.text);
t_lines.Lines.Add(tant.text+tsep.text+t_send.text);
t_send.Text:='';
end;
end
else begin
if key=chr(13) then begin
if c1.Checked=false then client.Socket.SendText(tant.text+tsep.text+t_send.text)
else client.Socket.SendText('_send_'+tnr.Text+'_'+tant.text+tsep.text+t_send.text);
t_lines.Lines.Add(tant.text+tsep.text+t_send.text);
t_send.text:='';
end;
end;
end;
procedure Tmain.lclMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lcl.Font.style:=[fsbold];
end;
procedure Tmain.lclMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lcl.Font.style:=[];
end;
procedure Tmain.lclClick(Sender: TObject);
begin
t_lines.Text:='';
end;
procedure Tmain.clientConnect(Sender: TObject; Socket: TCustomWinSocket);
begin
msg('Connected !');
client.Socket.SendText('connected_'+tant.text);
end;
procedure Tmain.clientDisconnect(Sender: TObject;
Socket: TCustomWinSocket);
begin
msg('Disconnected !');
tant.Enabled:=true;
llis.Enabled:=true;
ldis.enabled:=false;
lcon.enabled:=true;
end;
procedure Tmain.clientRead(Sender: TObject; Socket: TCustomWinSocket);
var
nr,s:integer;
m:string;
begin
m:=socket.ReceiveText;
if copy(m,1,6)='_list_' then begin
list.Items.Clear;
m:=copy(m,7,length(m)-6);
list.Items.CommaText:=m;
end
else t_lines.lines.add(m);
end;
procedure Tmain.c1Click(Sender: TObject);
begin
if c1.checked=false then tnr.enabled:=false
else tnr.enabled:=true;
end;
procedure Tmain.ldiscMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ldisc.Font.style:=[fsbold];
end;
procedure Tmain.ldiscMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
ldisc.Font.style:=[];
end;
procedure Tmain.ldiscClick(Sender: TObject);
begin
serv.socket.Connections[strtoint(tnr.text)].Destroy;
end;
procedure Tmain.linfoClick(Sender: TObject);
begin
msg('Programing by Busuioc Andrei'+chr(13)+'http://www28.brinkster.com/devland '+chr(13)+'adevland@yahoo.com');
end;
procedure Tmain.linfoMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
linfo.Font.style:=[fsbold];
linfo.Font.color:=clwhite;
end;
procedure Tmain.linfoMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
linfo.Font.style:=[];
linfo.Font.color:=clblack;
end;
procedure Tmain.lipClick(Sender: TObject);
begin
if main.color=clwhite then begin
fm.Color:=$009B9B9B;
fm.font.Color:=clwhite;
fm.shape1.Pen.Color:=clwhite;
fm.shape2.Pen.Color:=clwhite;
main.color:=$009B9B9B;
main.font.Color:=clwhite;
shape1.Pen.Color:=clwhite;
shape2.Pen.Color:=clwhite;
end
else begin
fm.Color:=clwhite;
fm.font.Color:=clblack;
fm.shape1.Pen.Color:=clblack;
fm.shape2.Pen.Color:=clblack;
main.color:=clwhite;
main.font.Color:=clblack;
shape1.Pen.Color:=clblack;
shape2.Pen.Color:=clblack;
end;
end;
procedure Tmain.lipMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lip.Font.style:=[fsbold];
end;
procedure Tmain.lipMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
lip.Font.style:=[];
end;
procedure Tmain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if client.Active=true then client.Socket.SendText('disconnected_'+tant.text);
end;
procedure Tmain.listChange(Sender: TObject);
begin
tnr.Text:=inttostr(list.ItemIndex);
end;
end.
source ini aku ambil dari internet..
tapi udah lama ada di komputer ku
jadi ga ingat lagi...ambil dimana...
more 18 years ago
DelphiExpert
It's very simple to build chat program :P
Flow-nya kayak gini:
Bikin TCPServer (Indy misalnya), set listening port-nya. Set active:= True
- Buat thread / timer untuk menge-cek adanya transmisi data baru untuk tiap2 client/socket yang terkoneksi
- Baca secara interval pesan yang masuk
- Parse perintah text-nya
- Balas sesuai request
Untuk clientnya:
Bikin aplikasi baru, taruh TCPClient component (Indy misalnya).
- Set remote host-nya. Arahkan ke IP dimana ChatServer nyala
- Set port-nya, sesuaikan dengan port ChatServer
- Kirim perintah dengan format data sesuai kesepakatan. Misal: "connect=Delphi&password=Expert"
- Buat thread / timer untuk menge-cek adanya transmisi data baru dari server
SELESAI
mudah bukan...
Untuk chat plus voice, kamu harus bikin library audio capture and streaming player dulu.
Baru dikasih command khusus untuk mengaktifkan audio-chat. Trus bikin thread baru untuk network audio controlnya.
Selain bikinan M-KIOS, saya juga telah develop network audio streaming + video-nya.
Kemampuannya nggak cuman peer-to-peer connection tapi support broadcast untuk masing-masing channel-nya. Live conversation gitu loh...
Sayang belum gua publikasikan, masih belum sempet. Proyek yg lain bejibun hehe...
Hope this can help you...
Best Regards - The DelphiExpert :D
more 18 years ago
glpro
Teman-teman saya lagi coba-coba bikin aplikasi chatting, pake komponen Indy, trus saya liat ada demonya+codenya. http://www.projectindy.org/DemoDownloads/Indy9Demos_26Oct04.zip
Saya coba otak-atik sample tentang aplikasi chatting. Ada yang ingin saya tanyakan:
1. Kenapa ketika client dihubungkan dengan server, aplikasi jadi seperti hang? Apa karena pengaruh dari timer ini ?
procedure TForm1.Timer1Timer(Sender: TObject);
var
Com,
Msg : String;
begin
if not IdTcpClient1.Connected then
exit;
Msg := IdTCPClient1.ReadLn('', 5);
if Msg <> '' then
if Msg[1] <> '@' then
begin
{ Not a system command }
memLines.Lines.Add(Msg);
end
else
begin
{ System command }
Com := UpperCase(Trim(Copy(Msg, 2, Pos(':', Msg) -2)));
Msg := UpperCase(Trim(Copy(Msg, Pos(':', Msg) +1, Length(Msg))));
if Com = 'CLIENTS' then
lbClients.Items.CommaText := Msg;
end;
end;
2. Kira-kira bagaimana ya solusinya ?
3. Perbedaan antara timer dan thread itu apa ya?
Makasih sebelumnyamore ...
reply |
Report Obsolete
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- help dun:pencarian di bnyk tabel
by skyblue in Paradox more 17 years ago - membuat TComponen pada saat runtime
by old_shutterhand in Tip n Trik Pemrograman more 17 years ago - Popup Menu ??
by Grandong in Tip n Trik Pemrograman more 17 years ago - Koneksi ke MS SQL Server
by diraf_seira in MsSQL more 18 years ago - Reinsstall Delphi, tidak bisa Compile dan Build
by novidini in Hal umum tentang Pascal Indonesia more 18 years ago - Koneksi delphi - MySQL yang paling bagus
by em052007 in Tip n Trik Pemrograman more 17 years ago - Please Help
by oktavianus783 in Hal umum tentang Pascal Indonesia more 15 years ago - Undangan: PHP Developers Day
by LuriDarmawan in OOT more 16 years ago - [TANYA] algoritma motion detection VCL video 4.01
by nurmanwiguna in Multimedia & Graphic Enhancement more 13 years ago - tanya dunk
by sidiq_himura in Hal umum tentang Pascal Indonesia more 16 years ago