| help | account  


Essential Wininet
View Larger Image
Aaron Skonnard
Addison-Wesley, Paperback, Published December 1998, 501 pages, ISBN 0201379368
List Price: $54.99
Our Price: $34.50
You Save: $20.49 (37% Off)


FREE Shipping on Orders over $40!*
Availability: Out-Of-Stock

Customer Reviews: 1     Average Customer Rating:

Write a Review and tell the world about this title!

Books on similar topics, in best-seller order:

Books from the same publisher, in best-seller order:

The era of stand-alone, self-contained applications is rapidly ending. Distributed, networked applications have become critical to meeting business needs in a fast-paced, dynamic world. Until now, building networked Windows applications wasn't easy. But now Microsoft has released a powerful new Windows Internet API (WinInet) that dramatically simplifies the process of creating Internet-enabled Windows applications.

WinInet makes it possible to create Windows applications that can download Web pages, access server applications, upload and download files, and traverse Gopher document systems--allowing developers to build such sophisticated Windows Internet applications as full-fledged Web browsers, home banking applications, and stock portfolio programs.

Essential WinInet is a comprehensive guide to this powerful Windows Internet API. It starts with a tutorial on WinInet basics and a methodical description of the API's protocol-specific functions for HTTP, FTP, and Gopher, then proceeds to explore more advanced topics, examining how WinInet works with other Internet tools and client/server technologies. This book addresses such essential topics as:

  • Using WinInet with MFC and Visual Basic
  • Understanding asynchronous WinInet
  • Writing HTTP COM components
  • Establishing dial-up connections, including applying the RAS API
  • Introducing the concept of client/server Internet programming
  • Implementing a complete client/server solution using WinInet with ISAPI and ASP

Numerous sample applications throughout this book explore WinInet's capabilities and show you how to put the API to work. The samples include a full-featured asynchronous FTP client for Windows; a stock portfolio application that can connect to real-time Internet stock quote providers; and a client/server application that incorporates WinInet, ISAPI, and ASP. Much more than just a tutorial, this practical resource contains the kinds of pointers, work-arounds, and creative solutions that will save you hours of frustration and inspire you to make full use of the API.

Contents

Preface xvii

Organization xviii
Tips xix
Web Site xix

Acknowledgments xxi

Part I WinInet Basics 1

Chapter 1 WinInet Basics 3

Is This Book for You? 4
Prerequisites 5
Book Overview by Chapter 6
Internet Overview 8
Developing Internet Applications 9
Internet Protocols 10
Clients 12
Server Components 13
Introducing WinInet 13
Standard API 14
What Can You Do with WinInet? 14
HTTP, FTP, and Gopher 15
Dependencies 15
Redistributing WinInet 15
Programming with WinInet 17
Windows CE 17
Documentation and Samples 18
Microsoft Internet Client SDK 18
Samples 19
Advantages of WinInet over Winsock 19
Easy to Use 20
Built-in Caching 20
Easy Connections 20
Security 21
Advantages of Winsock over WinInet 22
Your First WinInet Program 22
Conclusion 25

Chapter 2 WinInet General Functions 27

API Flags 28
HINTERNET Handles 28
WinInet General Functions 28
Handle Hierarchy 29
InternetOpen 30
The Next Step 36
InternetConnect 38
InternetSetStatusCallback 42
InternetCloseHandle 47
General Internet Function Summary 48
Internet File Functions 48
InternetReadFile 49
InternetWriteFile 51
InternetFindNextFile 51
InternetSetFilePointer 51
Reading Files without the Content-Length Header 52
Locking File Resources 52
Internet Option Functions 53
Internet Time Functions 55
Other Internet Helper Functions 55
InternetConfirmZoneCrossing 55
InternetErrorDlg 59
InternetGetLastResponseInfo 59
Conclusion 61

Chapter 3 Handling URLs 63

URL Basics 64
InternetOpenUrl 68
Using SSL with InternetOpenUrl 72
Helper Functions 73
InternetCanonicalizeUrl 73
InternetCombineUrl 75
InternetCrackUrl 75
InternetCreateUrl 77
InternetOpenUrl Sample Program (InetURL) 78
Processing OnFetch 80
HTTPS Example 81
FTP Example 82
Gopher Example 84
Conclusion 85

Part II WinInet Protocol-Specific Functions 87

Chapter 4 HTTP Functions 89

The HTTP Protocol 89
The HTTP Model 90
The HTTP Request 91
The HTTP Response 99
Using Telnet to Test HTTP 101
A Complete HTTP Transaction 104
HTTP Protocol Summary 105
WinInet HTTP Functions 105
HTTP Hierarchy 106
HTTP Functions Overview 106
HttpOpenRequest 107
HttpAddRequestHeaders 113
HttpSendRequest 115
HttpQueryInfo 116
InternetErrorDlg 123
HTTP Authentication Techniques 123
Using SSL with HTTP 129
Web Page Retrieval Example 129
Conclusion 137

Chapter 5 FTP Functions 139

The FTP Protocol 139
The FTP Model 140
FTP Commands 141
FTP Replies 146
Minimum Implementation 150
A Typical FTP Scenario 151
Using Telnet to Test FTP 151
FTP Protocol Summary 151
WinInet FTP Functions 153
FTP Hierarchy 153
FTP Functions Overview 154
Sample FTP Client 155
FTP Function Descriptions 162
Conclusion 180

Chapter 6 Gopher Functions 181

The Gopher Protocol 181
The Gopher Model 183
Gopher Response Items 184
Gopher Selector String 185
Using Telnet to Test Gopher 186
Gopher Protocol Summary 186
Gopher+ 187
WinInet Gopher Functions 187
Gopher Hierarchy 188
Gopher Functions Overview 189
Sample Gopher Application 189
Function Descriptions 194
Conclusion 212

Part III MFC and Visual Basic 213

Chapter 7 WinInet MFC Internet Classes 215

Benefits 215
WinInet MFC Classes 216
Getting Started with MFC WinInet Support 216
CInternetSession 218
CInternetFile 234
CInternetConnection 241
HTTP Classes 243
FTP Classes 252
Gopher Classes 261
CInternetException 266
Global MFC Internet Functions 267
Conclusion 267

Chapter 8 WinInet in Visual Basic 269

VB 5.0 269
Microsoft Internet Transfer Control 270
Properties 272
Methods 272
Events 273
Sample Application Using OpenURL 273
Using WinInet Directly 277
Declarations 278
Revamped Sample Application Using InternetOpenUrl 279
Conclusion 282

Part IV Advanced WinInet 283

Chapter 9 Asynchronous WinInet 285

Synchronous versus Asynchronous 286
Pros and Cons 287
WinInet's Built-in Asynchronous Support 288
MyFTP: Asynchronous FTP Sample Application 289
Establishing the Asynchronous Internet Session 290
InternetStatusCallback 291
INTERNET_STATUS_CALLBACK 291
OnConnect 295
OnDisconnect 298
OnGet 298
OnPut 300
MyStatusCallback Implementation 301
FillRemoteList 306
The Rest of the Details 308
Conclusion 312

Chapter 10 Reusable WinInet COM Components 313

Stock Watcher Sample Application 315
The QuoteProvider Component 317
The CProviderYahoo Component 319
Adding Interface Methods 325
Didn't We Mean IQuoteProvider? 326
Connection Points 328
IQuoteProviderEvent 329
Creating Additional IQuoteProvider Components 340
The QuoteProvider Component Category 342
The HTTP Component 349
IHttpRequest Interface 349
WinInet and Threads--A Quick Thread Tutorial 352
HttpWorkerThread 358
The Stock Watcher Application 366
CQuoteProviderDlg 366
CQuoteProviderEventSink 370
Refresh All 370
Conclusion 375

Chapter 11 Establishing a Dial-up Connection 377

Prerequisites 378
WinInet Dial-up Functions 379
InternetAutodial and InternetAutodialHangup 379
InternetDial and InternetHangUp 382
InternetGoOnline 384
InternetGetConnectedState 385
InternetSetDialState 387
To Use or Not to Use . . . That Is the Question! 387
Remote Access Service 388
Using the RAS Common Dialogs 388
Begin and End a RAS Connection with RasDial and RasHangUp 397
Working with Phonebook Entries 401
Windows NT 4.0 RAS AutoDial 403
RAS Connection Information 411
Conclusion 414

Part V Internet Client/Server Applications 415

Chapter 12 Internet Client/Server Applications with WinInet, ISAPI, and ASP 417

Internet Client/Server Development Decisions 418
Client Decisions 418
Server Decisions 420
BugTracker: A Client/Server Bug-Tracking System 422
BugTracker Overview 422
Sample ISAPI Extension DLL 425
Active Server Pages 436
Generating an HTML View 440
Sample WinInet Client 443
Conclusion 450

Appendix A TCP/IP Tutorial 451

TCP/IP Protocol Layering 452
TCP 453
IP 456
The Physical Layer 460
Conclusion 460

Appendix B API Flags 461

Appendix C Internet Option Flags 465

Appendix D Error Messages 471

Appendix E Recommended Reading 477

WinInet 477
Internet Protocols 477
COM and ATL 478
Multithreading 478
ISAPI and ASP 479

Index 481


Customer Reviews

Customer Reviews: 1     Average Customer Rating:

Dec 7, 1999     Alex Meseguer from NJ, US
Excellent coverage and command of subject matter.
Great one to get started with Windows Internet API. It covers all the bases and more...



Forgot your password?
FAQs
Shipping Options
Returns
Your Orders
Your Account