After returning the URL call the Save method of webclient class as
static void Main(string[] args)
{
string pictureurl = GetPictureUrl("facebookid");
//Save the file
WebClient webClient = new WebClient();
webClient.DownloadFile("pictureurl", @"c:\myfile.jpg");
}
public static string GetPictureUrl(string faceBookId)
{
WebResponse response = null;
string pictureUrl = string.Empty;
try
{
WebRequest request = WebRequest.Create(string.Format("https://graph.facebook.com/{0}/picture", faceBookId));
response = request.GetResponse();
pictureUrl = response.ResponseUri.ToString();
}
catch (Exception ex)
{
//? handle
}
finally
{
if (response != null) response.Close();
}
return pictureUrl;
}