03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

452 ❘ CHAPTER 20 Networking<br />

Request Types<br />

The WebRequest class’s Create method understands the prefixes http://, https://,<br />

ftp://, and file://. You can derive other classes from WebRequest to support<br />

custom request types. Creating request objects to support custom request protocols is<br />

outside the scope of this book. For more information, see “Programming Pluggable<br />

Protocols” at msdn.microsoft.com/library/1f6c88af.aspx.<br />

The following table briefly summarizes the HTTP methods, which are the most confusing.<br />

Method<br />

Connect<br />

Get<br />

Head<br />

MkCol<br />

Post<br />

Put<br />

Purpose<br />

Represents an HTTP CONNECT command for use with a proxy.<br />

Represents an HTTP GET command, which downloads a resource.<br />

Represents an HTTP HEAD command. This is similar to a GET command<br />

except it returns only headers and not the actual resource.<br />

Represents an HTTP MKCOL command, which creates a new collection (for<br />

example, a collection of pages).<br />

Represents an HTTP POST command, which basically creates a new resource.<br />

Represents an HTTP PUT command, which can create or update a resource.<br />

The Ftp and File methods are more self-explanatory. The following list shows the Ftp methods.<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

AppendFile<br />

DeleteFile<br />

DownloadFile<br />

GetDateTimeStamp<br />

GetFileSize<br />

ListDirectory<br />

ListDirectoryDetails<br />

MakeDirectory<br />

PrintWorkingDirectory<br />

RemoveDirectory<br />

Rename<br />

UploadFile<br />

UploadFileWithUniqueName<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!