The principle of realizing TCP and UDP network service with Windows socket is introduced. At the same time,a method of Visual Basic programming of client/server application program based on TCP and UDP protocol with Winsock is introduced in this paper.