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?
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.
0
0
Lord Vadersays:
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.
1
0
Lord Vadersays:
B.streamwriter.write doesnt have a byte array overload
A and D are writing string literals to the stream not the file
C
https://msdn.microsoft.com/pl-pl/library/ez801hhe(v=vs.110).aspx
0
0
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.
0
0
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.
1
0
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
0
0