WinInet Tutorial for Beginners

WinInet Introduction

This tutorial guides you through basics of WinInet including how to use WinInet with HTTP, FTP, and Gopher protocols with real world examples.

There are five chapters in this tutorial.

Prerequisites: Windows API, MFC, OOP, basics of the Internet such as URL, protocols, HTTP, FTP, TCP/IP etc.

Internet Applications

Today, the web programming is a basic need for a developer. Starting from a manufacturing to engineering, document to e-commerce, every business is moving towards the Internet. Why wouldn't be? It’s easy to access, anywhere, anytime. You don't have to carry data with you. Just upload your data on one web server and you can access anywhere in the world.

Let's see a typical Internet application. Basically, there are three parts of an Internet application: the client (GUI interface), Server (Dlls, ASP, Database, or CGI), and communication between the client and the server (protocol).
Here is a typical Internet application model:



Internet Protocols

A protocol is a set of rules, which is required to communicate between two computers. Both computers must understand and implement these rules to talk to each other.

Application-level Internet Protocols

The Client and the server applications communicate one another via application-level protocols.
All application-level protocols are built on top of TCP/IP, which consists of lower-level protocols that provide the application-level protocol with a mechanism for reliable data transmission between computers. Every protocol has a port number, which is used to decide what protocol is used for connection. Here is a list of port numbers for various standard protocols:



Clients

It's a GUI Windows application with ability to communicate to server with the help of protocols. Clients use APIs to communicate with the servers.

Windows provides two kind of network APIs, WinInet and WinSock. The WinInet is an application-level API and supports only HTTP, FTP, and Gopher protocols. While WinSock is set of low-level APIs and supports most of the protocols described above.

Server Components

Server components typically sit on the web server to extend its functionality. Each component performs a specific task such as reading/writing to the database, performing calculations etc. These components are ASP, ISAPI dlls, or CGI scripts.
 
WinInet Vs. WinSock

  1. WinInet provides a higher level-programming interface, which is easy to use while WinSock, is a low level interface, which is hard to implement. To implement WinSock, you should have some knowledge of Windows Sockets and TCP/IP. While WinInet hides this all from developers and does every thing under the hood.
  2. WinInet provides support for only three protocols - HTTP, FTP, and Gopher while WinSock let you work with most of the protocols.
  3. WinInet supports build-in-caching which improves downloading performance. 
  4. WinInet provides easy connections and has support for proxy servers. 
  5. WinInet provides more security over WinSock. 

Basically choosing between WinInet and WinSock is pretty easy. If your application needs to access HTTP, FTP, or Gopher protocols then WinInet is better choice, whille WinSock is for rest. 

What is WinInet?

WinInet is high level, easy-to-use API to work with HTTP, FTP, and Gopher protocols. If you use WinInet, you don't have to worry about learning protocol specifications such as TCP/IP or Windows Sockets.

When to use WinInet?

Using HTTP, FTP, and gopher

  1. Download web pages, images, sounds, and video files. 
  2. Execute server files such as CGI scripts, ISAPI dlls, or ASP scripts. 
  3. Access remote database and file systems. 
  4. Perform web searches. 
  5. Download and Upload files between computers.

As you will walk through this tutorial, you will see how easy is working with WinInet and Internet protocols.

Other chapters of this tutorial

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值