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
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
C
https://msdn.microsoft.com/pl-pl/library/ez801hhe(v=vs.110).aspx
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.
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.
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