Click here to Skip to main content
Rate this: bad
good
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 Smile | :)
Posted 13-Dec-12 19: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
0 OriginalGriff 278
1 Maciej Los 205
2 DamithSL 193
3 Nguyen.H.H.Dang 190
4 arvind mepani 187


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