Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UNC path for Bitmap

Status
Not open for further replies.

brd24gor

MIS
May 18, 2005
123
US
I am having some problems creating a new Bitmap object with a UNC filepath. Here is my code:

Code:
Bitmap testPic = new Bitmap(@"\\scbcmain\data\Testing\defaultimage.png");

It works OK if I point it to a file on the local drive. If it makes any difference, I will be showing the file in a PictureBox control.

Thanks in advance!

--Brad
 
Use WNetAddConnection2() API to make a connection with that machine\folder and there access the file.
You need DllImport() and NETRESOURCE structure.
obislavu
 
How do I go about implementing these? The references I have found are rather vague on how to use WNetAddConnection2() and NETRESOURCE in C#.

I am pretty new at C# programming so I apologize if this is a simple problem.

Thanks,
Brad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top