vshed.IO.UncShare 1.0.1

Library for accessing UNC Shares with an alternative identity

Install-Package vshed.IO.UncShare -Version 1.0.1
dotnet add package vshed.IO.UncShare --version 1.0.1
<PackageReference Include="vshed.IO.UncShare" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add vshed.IO.UncShare --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

vshed.IO.UncShare

Library for accessing UNC Shares with an alternative identity

Example Usage

try
{
    using (var share = new UncShare(@"\\hostName\networkShareName", "userAccount", "password"))
    {
        Assert.IsTrue(share.GetFiles().Length >= 1);
        if (share.GetFiles().Length >= 1)
            Console.WriteLine("Files found");
        else
            Console.WriteLine("No files found");
    }
}
catch (System.ComponentModel.Win32Exception ex)
{
    if (ex.Message == "The network path was not found")
        Console.WriteLine("The specified UNC Path could not be found");
    else if (ex.Message == "The user name or password is incorrect")
        Console.WriteLine("The specified Username or Password is invalid");
    else
        Console.WriteLine(ex.Message);
}

vshed.IO.UncShare

Library for accessing UNC Shares with an alternative identity

Example Usage

try
{
    using (var share = new UncShare(@"\\hostName\networkShareName", "userAccount", "password"))
    {
        Assert.IsTrue(share.GetFiles().Length >= 1);
        if (share.GetFiles().Length >= 1)
            Console.WriteLine("Files found");
        else
            Console.WriteLine("No files found");
    }
}
catch (System.ComponentModel.Win32Exception ex)
{
    if (ex.Message == "The network path was not found")
        Console.WriteLine("The specified UNC Path could not be found");
    else if (ex.Message == "The user name or password is incorrect")
        Console.WriteLine("The specified Username or Password is invalid");
    else
        Console.WriteLine(ex.Message);
}

Release Notes

Initial release

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 180 3/10/2019
1.0.0 114 3/9/2019