Aswathy
Aswathy

Reputation: 83

How to get all folder name in a folder on remote system?

I like to know how to access all folder names inside a folder in remote system. I have a remote system called 'x'. Their is any way to access all folder in C:\oracle\oradata folder which is in remote system x? I am using c#.

Upvotes: 0

Views: 703

Answers (1)

Dai
Dai

Reputation: 155125

This question belongs on ServerFault or SuperUser.com, but anyway.

If you're using SMB (i.e. Windows File Sharing), then each volume (disk drive) on a computer is exposed as an "Administrative Share", which is the drive-letter followed by the $ symbol. These shares have permissions on them that only allow members of the local Administrators group access.

The paths are simple, so to access your example, it's: \\x\\C$\Oracle\Oradata\

These paths work from within C# too:

DirectoryInfo share = new DirectoryInfo(@"\\x\\C$\Oracle\Oradata\");

foreach(DirectoryInfo child in share.GetDirectories()) {
    Console.WriteLine( child.FullName );
}

Upvotes: 1

Related Questions