Built your own web browser with C ++ Builder

zhaozj2021-02-17  54

Have you thought about IE and NetCape? Have you ever checked an your own browser? Use C Builde to make you easily and efficiently create your own Internet programs. Basic languages ​​for C Builder C , So it can hardly do anything, through the component settings of C Builder, you can build Internet applications like other applications, meaning that you can extend these components to enhance their features, if needed, it can handle low Horizontal API details, because it is based on C . If you use the API (such as ISAPI) to create an Internet app, the tool you choose must use and create a DLL, and you can use the interface published by these DLLs. ---- Let us Look at its Internet components and features: ----------------------------------------- --------------- FTP supports the remote machine exchange file THTML supports analysis and planning HTML data and provides a scrollable view of a current HTML page to provide access to super text transfer protocol TNTTP provides reading Taking the ability of the newsgroup TPOP provides access POP3 Email Protocol TSMTP Support Transport Internet Mail Packet Group Provides accessing the Winsock Transfer Control Protocol (Customer and Server) TUDP provides access to Winsock User Data Map Agreement (Client and Server ---- Now we can start building our browser: ---- 1. Create a new project file first - Create a new form, set its CAPTION attribute to mybrowse, position properties Place a TTABControl component at the top of the form for PoscreeCenter, this control lists the URL listed in your browsing so that you easily return to the nodes you have visited, set the align's properties to Altop, which makes the program to run when it is always The top of the form, placing a TPANEL and set the align property to Albottom, so that it is on the bottom, deletes the CAPTION attribute in the object viewer, and sets the Tabod to 0. Add another TPANEL to the form to clear its CAPTION Attribute, and put two TbitBTN, Caption is set to Go and Home, put a Tcombobox at the bottom of the form, and remove his text property, when the program is running, you will type or pull the URL you want to access or drop. Finally, place a THML component on the form, which will display the web page you visited. You can write code. ---- 2. (1). Write code for TabControl's onchange event (synchronized CBURL and TCURL): cburl-> text = tcurl-> tabs-> strings [tcurl-> tabindex]; cburl-> selectall (); bbgo-> click (); // Click on the same effect as the point table ---- (2). Write the code for THTML ONBEGINRETRIEVE event: Cursor = (tcursor) cr HSLASS; if (cburl-> items-> indexof (htbrowser-> url) == - 1 ) {cburl-> items-> add (htbrowser-> URL); / / Check if TcomboBox keeps the URL cburl-> text = htbrowser-> url; // contains the address you want to browse , if it is cburl-> selectall (); // Add it to TcomboBox and TCURL-> Tabs-> add (htbrowser-> url); // TTabControl in tcurl-> TabINDEX = TCURL-> Tabs-> Count-1; bbgo-> click ();} ---- Crurse written for Thtml OneundRetrieve practice; cursor = (tcursor) CRDEFAULT;

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

New Post(0)