Jump to content

luineo

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Hi here is an example using c# string fileName = "picture.jpg", myStringWebResource = null; // Create a new WebClient instance. WebClient myWebClient = new WebClient(); // Concatenate the domain with the Web resource filename. myStringWebResource = "http://192.168.1.151/Streaming/channels/101/picture?snapShotImageType=JPEG"; Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource); string credentials = Convert.ToBase64String(System.Text.Encoding.ASCII.GetBytes("admin:12345")); myWebClient.Headers[system.Net.HttpRequestHeader.Authorization] = "Basic " + credentials; // Download the Web resource and save it into the current filesystem folder. myWebClient.DownloadFile(myStringWebResource, fileName); Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource); Console.WriteLine("\nDownloaded file saved in the following file system folder:\n\t" );
×