Sign in to follow this  
Followers 0
Mecrazycoder

File Transfer

4 posts in this topic

Hi frends,

I am currently developing window based Chat application(using TCP). I am half way trough. I got strucked, when i try to insert smiley option and try to enable file transfer option. My question is as follows

1.Is there any way to insert Smiley option.That is send and recieve smiley.

2.How to transfer file between two parties(involved in chat), I am using GUICtrlCtreateEdit control for chatting.

3.How can i change a layout that titlebar color, scroll bar color.

Please reply me by quoting examples or syntax.

Thanks in advance


[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

@Mecrazycoder

Of course its possible, an extract of my FT_Pocket here :

Sender :

TCPStartUp( )
$f_Socket = TCPConnect($s_IP, $s_port) ;open TCP connexion
;declare $s_file as your smiley file
$f_fopen = FileOpen($s_file, 16) ;open file in binary mode
$s_Data = FileRead($f_fopen) ;read binary string to send
TCPSend($f_Socket, $s_Data) ;send binary string
TCPCloseSocket($f_Socket)
FileClose($f_fopen)
TCPShutdown( )

Receiver :

$f_Listen = TCPListen($s_lip, $s_port)
$f_Socket = TCPAccept($f_Listen)

;declare $s_output as the smiley that you will receive
$f_fopen = FileOpen($s_output, 18) ;open the file in binary for write
;declare $f_size as the size of the smiley that you will receive (in bytes)
$s_Data = TCPRecv($f_Socket, $f_size)
TCPCloseSocket($f_Socket)
FileClose($f_fopen)
TCPShutdown( )

Cheers, FireFox.

Edited by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

@Quickest obfuscated spammer,

Tanx man. But i am expecting something different.Please go through my code. In GUICtrlCreateEdit for displaying chat,in that window i want to drag a file and drop over it.this can be perform on both ends.

ChatWindowClient_v1.4.au3

ChatWindowServer_v1.4.au3


[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

@Mecrazycoder

Of course its possible, an extract of my FT_Pocket here :

Sender :

TCPStartUp( )
$f_Socket = TCPConnect($s_IP, $s_port) ;open TCP connexion
;declare $s_file as your smiley file
$f_fopen = FileOpen($s_file, 16) ;open file in binary mode
$s_Data = FileRead($f_fopen) ;read binary string to send
TCPSend($f_Socket, $s_Data) ;send binary string
TCPCloseSocket($f_Socket)
FileClose($f_fopen)
TCPShutdown( )

Receiver :

$f_Listen = TCPListen($s_lip, $s_port)
$f_Socket = TCPAccept($f_Listen)

;declare $s_output as the smiley that you will receive
$f_fopen = FileOpen($s_output, 18) ;open the file in binary for write
;declare $f_size as the size of the smiley that you will receive (in bytes)
$s_Data = TCPRecv($f_Socket, $f_size)
TCPCloseSocket($f_Socket)
FileClose($f_fopen)
TCPShutdown( )

Cheers, FireFox.

Please do help me...


[size="4"][font="Arial Narrow"][font="Garamond"]Attitude is a little thing that makes a big difference[/font][/font][/size][indent][/indent]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0