2

I am looking for cifs/smb client library in C# for accessing a SMB share from windows cifs client.

Any code snippet is highly appreciated.

2
  • The normal approach is to simply mount the Samba share and access it via the filesystem APIs. Is there some reason you can't do that? Commented Jul 20, 2010 at 10:08
  • Mounting Samba share via net use command you mean to say ? Commented Jul 20, 2010 at 10:13

1 Answer 1

1

Just access files using the normal IO routines using UNC paths, e.g. \\servername\sharename\file1.txt

2
  • @ Richard :No I want to know Like for mounting to my local system drive i should use net use command or i have to use some other way. I want to access Samba share via C#. I am doiing that currently using Management class in C# and i am using net use command for mapping that to my local system drive. Commented Jul 20, 2010 at 10:50
  • You say "I want to access Samba share via C#" - this is not at all clear! You can access files on a Samba share using the normal IO routines. If what you're trying to do is mount/unmount mapped drives, that's something different. The net use command would do the job, and you say that you currently use the Management class, but you didn't say what is wrong with that approach, or what you can't get to work.
    – Richard
    Commented Jul 23, 2010 at 8:34

Not the answer you're looking for? Browse other questions tagged or ask your own question.