Home Ask Login Register

Developers Planet

Your answer is one click away!

MSTdev February 2016

How to access network path if any space available in path

my network path

// snaps/dms/DH2304139/DH2304139_1_2_635023304446654623.jpg

now I tried with below but not worked

string imagePath = "// snaps/dms/DH2304139/DH2304139_1_2_635023304446654623.jpg";

imagePath = "@"+"'" + imagePath +"'"  ;


NikolaiDante February 2016

The UNC format for a network file path is:

string imagePath = @"\\\karomi snaps\dms\DH2304139\DH2304139_1_2_635023304446654623.jpg";

I've added an @ to avoid the first two \ being escaped. The space itself shouldn't cause an issue, assuming the account the app / site is running under has permission to connect to the share. You shouldn't need to wrap this in single quotes.

Post Status

Asked in February 2016
Viewed 1,483 times
Voted 12
Answered 1 times


Leave an answer

Quote of the day: live life