Recent

Author Topic: Is There any SMB Protocol Units or Components ?  (Read 4375 times)

Coldzer0

  • Jr. Member
  • **
  • Posts: 50
Is There any SMB Protocol Units or Components ?
« on: December 02, 2017, 08:30:49 pm »
Hello all

i'm searching for SMB Protocol Unit or library or anything i can use to connect to SMB Server
especially SMB2 or SMB3

i search google for 3 days but nothing  :'(

thanks in advanced 

mirce.vladimirov

  • Sr. Member
  • ****
  • Posts: 256
Re: Is There any SMB Protocol Units or Components ?
« Reply #1 on: December 02, 2017, 10:18:48 pm »
What exactly do you need ?
SMB is used to access a certain share on a remote PC.
For which operating system your executable is developed ? If it's windows then you could use TProcess like :
Code: Pascal  [Select][+][-]
  1. var
  2. Process1 : TProcess ;
  3. begin
  4.     Process1.CommandLine:='net use \\192.168.0.5\RemoteFolderName /U:Administrator password';  // replace IP address, remote folder name and "Administrator" and "password" as you need
  5.     Process1.Execute;
  6.  
  7.  
  8. // now you can do what ever you need to, read,copy,delete,move files to and from the network share
  9.  
  10.  
  11. // to disconnect  the remote shared folder :
  12.     Process1.CommandLine:='net use /delete \\192.168.0.5\RemoteFolderName ';
  13.     Process1.Execute;  
  14.  

Under Linux you should  "mount" instead of "net use".

Coldzer0

  • Jr. Member
  • **
  • Posts: 50
Re: Is There any SMB Protocol Units or Components ?
« Reply #2 on: December 02, 2017, 10:54:27 pm »
i need a SMB Client library to connect using TCP

not using other tools

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Is There any SMB Protocol Units or Components ?
« Reply #3 on: December 02, 2017, 10:58:10 pm »
Afaik there is a libsmbclient in samba?

Coldzer0

  • Jr. Member
  • **
  • Posts: 50
Re: Is There any SMB Protocol Units or Components ?
« Reply #4 on: December 02, 2017, 11:32:09 pm »
Afaik there is a libsmbclient in samba?


is there any Pascal Headers for it ?

rvk

  • Hero Member
  • *****
  • Posts: 6163
« Last Edit: December 02, 2017, 11:49:12 pm by rvk »

Coldzer0

  • Jr. Member
  • **
  • Posts: 50
Re: Is There any SMB Protocol Units or Components ?
« Reply #6 on: December 04, 2017, 03:09:26 am »
i can't find any libsmbclient binaries :(

i try to compile samba but i got a lot of errors

please if there's any way to get a Multi OS smb client or even just for windows i hope that someone can help

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: Is There any SMB Protocol Units or Components ?
« Reply #7 on: December 04, 2017, 03:51:16 pm »
Wat exactly are you trying to do? I don't think you'll find a ready-made unit to do what you want from low level TCP perspective.

SMB had many different versions and security so even if you could communicate with a server on such a low level as TCP, you'll have a hell of a time to get all this working correctly.

Using a library like libsmbclient will be much easier.
In Windows you could use the Windows-api to make connections etc.

But I haven't found ready made headers for the Samba libraries of Windows.
But it depends on what you want to do, if you really need them.

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365233(v=vs.85).aspx
Quote
The client and server establish a NetBIOS session.
The client and server negotiate the Microsoft SMB Protocol dialect.
The client logs on to the server.
The client connects to a share on the server.
The client opens a file on the share.
The client reads from the file.

For example, do you want to use NetBIOS to access SMB?
https://superuser.com/a/694480/235723

 

TinyPortal © 2005-2018