MSTdev February 2016

How to access network path if any space available in path

my network path

//172.12.0.11/karomi snaps/dms/DH2304139/DH2304139_1_2_635023304446654623.jpg

now I tried with below but not worked

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

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

Answers


NikolaiDante February 2016

The UNC format for a network file path is:

string imagePath = @"\\172.12.0.11\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

Search




Leave an answer