Click here to Skip to main content
12,697,699 members (26,292 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
I want to use a folder in remote pc on my local network
i already ensure all the permission and remote pc share the folder also i add the code on web config
identity impersonate="true"
but whenever i want to access the the folder it gone to the C: path.
How can i access the folder
  path = "\\HP-PC\\GetFiles";
  String[] fileNamesWithoutExtention = Directory.GetFiles(@path,      "*.jpg").Select(fileName => Path.GetFileNameWithoutExtension(fileName)).ToArray();

Here the PC Name HP-PC
Folder Name GetFiles
Error:
Could not find a part of the path 'C:\HP-PC\GetFiles\'.

I will be thankful if anybody help :)
Posted 13-Dec-12 20:50pm

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

The problem is with the escape characters defined in path variable. Try this:

string path = @"\\HP-PC\GetFiles";
            String[] fileNamesWithoutExtention = Directory.GetFiles(@path, "*.avi").Select(fileName => Path.GetFileNameWithoutExtension(fileName)).ToArray();
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100