Write the sending image file program in C ++ Builder (1)

zhaozj2021-02-17  51

ICQ can realize data transfer of point-to-point, but if you want to give a multimedia image file to the other party, it is more difficult. However, you can use the C Builder 5.0 control to write an application for sending an image.

Open C Builder 5.0, create a new project, add NMSTRM, NMSTRMSERV, OpenPictialog control in Form1, add 2 Button control, 1 Label control, 2 EDIT controls, and 1 Statusbar control.

First we have aware of the NMSTRM control, NMSTRMSERV control, and OpenPictureDialog controls. The NMSTRM control is a TCP / IP-based control that can receive the data stream and then send it to the server via the network. The NMSTRMSERV control is a data stream that can receive from the client. The server only monitors the TCP / IP port and is not responsible for listening to the UDP port. The OpenPictureDialog control is to open image files for browsing or editing. The design is shown below:

The properties of various controls are as follows:

Control Name Property Value FormCaption transmitting image ImageNameImage1Buttonname = Button1, Caption = transmission Buttonname = Button2, Caption = display Buttonname = Button3, Caption = open Labelname = Label1, Caption = remote host: EditnameEdit1EditnameEdit2NMStrmnameNMStrm1NMStrmServnameNMStrmServ1OpenPictureDialognameOpenPictureDialog1StatusBarnameStatusBar1

转载请注明原文地址:https://www.9cbs.com/read-29475.html

New Post(0)