Skip to content
An utility to access Windows (SMB/CIFS) shares with credentials.
C#
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
VPKSoft.UNCUtil
.gitignore
LICENSE
README.md
VPKSoft.UNCUtil.sln

README.md

VPKSoft.UNCUtil

An utility to access Windows (SMB/CIFS) shares with credentials.

Usage

try // an error might occur..
{
  // IDisposable so using..
  using (UNCLogin share1 = new UNCLogin(@"\\server1\share1",
    new System.Net.NetworkCredential("username1", "password1", "domain1")))
  {
    // IDisposable so using..
    using (UNCLogin share2 =
      new UNCLogin(@"\\server2\share2", new System.Net.NetworkCredential("username2", "password2", "domain2")))
    {
      // a normal file operation with the given credentials.
      File.Copy(@"\\server1\share1\somefile.dat", @"\\server2\share2\somefile.dat");
    }
  }
}
catch (Exception ex)
{
  // show the error message..
  MessageBox.Show(ex.Message);
}
You can’t perform that action at this time.