Code Monkey home page Code Monkey logo

sharpcifs's Introduction

###INTRODUCTION

SharpCifs is a port of JCIFS to C# for make your Windows Phone 8.1 (Silverlight) apps capable to work with network shares.

It was ported using the Lluis Sanchez's already compiled Sharpen (found at https://github.com/mono/ngit/tree/master/gen/plugins) and applying a lot of changes to make the port works.

###SETTINGS

All client settings are same as jCifs, you can take a look at: https://jcifs.samba.org/src/docs/api/overview-summary.html#scp

If you want to use the NetBIOS name resolution you must set the "jcifs.netbios.laddr" with phone's IP address, and "jcifs.netbios.baddr" with the broadcast address.

###NOTES

  • The JCIFS version ported to C# was 1.3.17.
  • By default I have disabled the DFS support due a problems with Microsoft accounts when you try to connect to your Windows 8.1. You can enable it by setting to true the "jcifs.smb.client.enabledfs" property.
  • I added a new method GetHosts on NbtAddress class to find hosts on small networks.

###LINKS

The original Java project can be found at: http://jcifs.samba.org

sharpcifs's People

Contributors

zinkpad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sharpcifs's Issues

Possibility of a Universal App version

Hi,

First of all many thanks for taking the time to port jcifs to C#. As expected this works very well in WP8.1 silverlight apps, however I was wondering if you can look into having a Universal App version as well.

Right now If I use the dll in a universal app I get the following error:
Cannot find type System.Security.Cryptography.HashAlgorithm in module mscorlib.dll.

I am guessing this is happening because System.security isnt available in UWP.

Regards

SmbSession.Logon error

after check the source.. change to -1 may be ok

SmbSession.cs

public static void Logon(UniAddress dc, NtlmPasswordAuthentication auth)
{
        //Logon(dc, 0, auth);//  change to -1
    Logon(dc, -1, auth);
}

GetShareSecurity() returns null despite admin account

I'm calling GetShareSecurity(); method (both with false/true) on a smb share and it always returns null despite using Administrator credentials when loging to smb windows server. I'm able to list all the the shares using ListFiles() without troubles. Using GetSecurity() I always catch timeout exception:

Transport1 timedout waiting for response to SmbComSessionSetupAndX[command=SMB_COM_SESSION_SETUP_ANDX,received=False,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=0,pid=41146,uid=0,mid=23,wordCount=12,byteCount=69,andxCommand=0xFF,andxOffset=0,snd_buf_size=16644,maxMpxCount=10,VC_NUMBER=1,sessionKey=0,lmHash.length=0,ntHash.length=0,capabilities=-2147479468,accountName=,primaryDomain=,NATIVE_OS=Windows,NATIVE_LANMAN=jCIFS]

Could anyone help on that. Here simplified code snippet. I can provide more details if needed:

            var smbPath = "smb://" + targetIP;
            var authOption = new NtlmPasswordAuthentication("Administrator:XXX") 
            var smbShares = new SmbFile(smbPath, authOption);
                try
                {
                    var shares = smbShares.ListFiles();
                    foreach (var share in shares)
                    {                
                        Console.WriteLine($"Share Name = {share.GetName()}"); //works
                        var sSec = share.GetShareSecurity(true); //always null though
                        var test = share.GetSecurity(); //always response timeout
                    }
                }
                catch (Exception e)
                {}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.