0

I was trying to open an image from a file folder with authentication using the Image.FromFile method but an error is occurring when I access the image.

NotSupportedException was unhandle by user code. The given path's format is not supported.

The filename I use is like this:

\\10.10.1.123\shared\picture.jpg passwrd /USER:compname\userwithaccess

Where passwrd is the password of the user userwithaccess in the domain name of compname.

That path is working when I paste it in the Run, it opens the image, but why is it not working with Image.FromFile in my application?


My code is in C#, framework is in .NET 4.0. Project is a WCF Service, to be hosted in IIS, build on Visual Studio 2010 Pro.

John Isaiah Carmona
  • 5,260
  • 10
  • 45
  • 79
  • "The given path's format is not supported." Is that not self-explanatory? Look at the string you are passing in... see anything that might cause the issue? – Ste May 16 '12 at 08:14

1 Answers1

1

Have a look at WindowsIdentity.Impersonate method.

@ msdn

animaonline
  • 3,715
  • 5
  • 30
  • 57