Not able to map a network drive using WshNetwork_Class.mapnetworkdrive in c# -


i have created windows service map network drive.in onstart method trying map drive using below code

iwshnetwork_class network = new iwshnetwork_class(); network.mapnetworkdrive(drive, @remotename, type.missing, username, password]); 

it throws exception

the local device name in use. (exception hresult: 0x80070055)."

but when check explorer drive not connected.when map using mycomputer->map networkdrive able map it. please me sort out.

protected override void onstart(string[] args) {    string drive = "z:";   string remote = @remotename;   if (!directory.exists(drive))   {      iwshnetwork_class network = new iwshnetwork_class();      network.mapnetworkdrive(drive, @remotename, type.missing, configurationmanager.appsettings["username"], configurationmanager.appsettings["password"]);   } } 


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -