Android Question Connect to windows 10 pro with smb

kalarius

Active Member
Licensed User
I try to connect to share folder (windows 10 pro)
with the smb but always fail

my code is
filename=EditText3.Text
mysmb.Initialize("mysmb")
mysmb.SetCredentials(user,pass,"") ''no domain

Dim Geniko As String
Geniko="smb://" & EditText4.text ''' edittext4.text= mobuser-pc/temp
mysmb.DownloadFile(Geniko,filename,File.DirRootExternal,filename)

any suggestion?

I have test with file explorer program and I can download the file
 

kalarius

Active Member
Licensed User
the line is Geniko="smb://" & EditText4.text
and the remark ''' edittext4.text= mobuser-pc/temp to show what is the content of the edittext4.text

I have the same problem with windows XP professional
 

Erel

Administrator
Staff member
Licensed User
Please use [code]code here...[/code] tags when posting code. With code tags we could have understood your code.

Do you get any error? Can you post it?
 

kalarius

Active Member
Licensed User
my code is
B4X:
Sub Button1_Click
     

Try
        File.Delete (File.DirRootExternal,"sms.txt")
Catch
    Log(LastException)
End Try

    GraceStoixeiaStofile
    Dim user As String
    Dim pass As String
    user=EditText1.Text
    pass=EditText2.Text
    Dim filename As String
    filename=EditText3.Text
    mysmb.Initialize("mysmb")
    mysmb.SetCredentials(user,pass,"")
   
    Dim Geniko As String
    Geniko="smb://" &  EditText4.text
    mysmb.DownloadFile(Geniko,filename,File.DirRootExternal,filename)

    awake.KeepAlive(True)
     
End Sub

edittext1 and edittext2 contain the username and password (user user)
the edittext4 is the share directory of the windows 10 (mobuser-pc/temp)

it does not return any error


B4X:
Sub mysmb_DownloadCompleted (Url As String, RemoteFile As String, Success As Boolean)
    ' edo stamatv
'    Dim myS As String

If Success=False Then    
    EditText5.Text="Αποτυχία"
    Else
    EditText5.text=File.ReadString(File.DirRootExternal,EditText3.text)   
    myClip.clrText
    myClip.setText(EditText5.Text)
    End If
End Sub
it always return success=false

*** inside the temp directory there is a file sms.txt that I want to read it contant and write at edittext5.text

I have the same problem with windows XP
I try with file explorer (smb protocol) program and I can connect to both windows 10 and window XP and read the file.
 

Erel

Administrator
Staff member
Licensed User
Don't initialize SMB every request.

What is the output of Log(LastException) in DownloadCompleted event?
 
Top