Which code should you use?

You have an application that accesses a Web server named Server1.
You need to download an image named Imagel.jpg from Server1 and store the image locally as
Filel.jpg.
Which code should you use?

You have an application that accesses a Web server named Server1.
You need to download an image named Imagel.jpg from Server1 and store the image locally as
Filel.jpg.
Which code should you use?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 4

Your email address will not be published. Required fields are marked *


Najlepszy Programista

Najlepszy Programista

The WebClient class provides common methods for sending data to or receiving data from any local, intranet, or Internet resource identified by a URI. The WebClient class uses the WebRequest class to provide access to resources.

Lord Vader

Lord Vader

WebClient.DownloadFile

public void DownloadFile(
string address,
string fileName
)

address
Type: System.String
The URI from which to download data.
fileName
Type: System.String
The name of the local file that is to receive the data.

Lord Vader

Lord Vader

B.streamwriter.write doesnt have a byte array overload

A and D are writing string literals to the stream not the file

has to be C