I'm trying to read data from a JPG image from a URL with authentication. This is an example in C #, but not for NETMF.
In NETMF 4.2,I can't find the property Preauthenticate.
As I read you need to set its value to "true" to effectively accompany credentials.
Someone could help me with an example that reads an image from a password-protected URL, and guide me on how to read the Stream, as the examples found on the Internet using Image.FromStream class, which is not found in. NETMF
Regards, Pablo
// Create a new webrequest to the mentioned URL. WebRequest myWebRequest=WebRequest.Create(url); // Set 'Preauthenticate' property to true. Credentials will be sent with the request. myWebRequest.PreAuthenticate=true; Console.WriteLine("nPlease Enter ur credentials for the requested Url"); Console.WriteLine("UserName"); string UserName=Console.ReadLine(); Console.WriteLine("Password"); string Password=Console.ReadLine(); // Create a New 'NetworkCredential' object. NetworkCredential networkCredential=new NetworkCredential(UserName,Password); // Associate the 'NetworkCredential' object with the 'WebRequest' object. myWebRequest.Credentials=networkCredential; // Assign the response object of 'WebRequest' to a 'WebResponse' variable. WebResponse myWebResponse=myWebRequest.GetResponse();