12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Net;
- using SmbSvr.Ramfs;
- using SMBLibrary;
- using SMBLibrary.Authentication.GSSAPI;
- using SMBLibrary.Authentication.NTLM;
- using SMBLibrary.Server;
- using SMBLibrary.Win32;
- using Utilities;
- namespace RamDismbk
- {
- internal class Program
- {
- private static void Main()
- {
- Console.Write("I...");
- var shareCollection = new SMBShareCollection();
- shareCollection.Add("Ramfs", new RamfsFileSystem(), CachingPolicy.NoCaching);
- shareCollection.Add(new FileSystemShare("RamfsNt", new RamfsNtFileStore(), CachingPolicy.NoCaching));
- shareCollection.Add(new FileSystemShare("Z", new NTDirectoryFileSystem("Z:\\"), CachingPolicy.NoCaching));
- var smb = new SMBServer(shareCollection, new GSSProvider(new IndependentNTLMAuthenticationProvider(p => "")));
- Console.Write("S...");
- smb.Start(IPAddress.Parse("10.0.0.1"), SMBTransportType.DirectTCPTransport);
- Console.Write("R...");
- smb.LogEntryAdded += delegate (object sender, LogEntry entry)
- {
- if (entry.Severity < Severity.Information)
- Console.WriteLine($"{entry.Severity}{entry.Message}");
- };
- Console.ReadLine();
- Console.Write("E..");
- smb.Stop();
- }
- }
- }
|