0

Possible Duplicate:
Trying to use SmbFileInputStream

This question has been asked several times but they aren't helping me.
I'm trying to use SmbFileInputStream to connect my Android to my PC, but the app aborts without an error message.
The applicable code looks like this:

SmbFileInputStream inFile = null;  
jcifs.Config.setProperty( "jcifs.netbios.wins", "192.168.2.2" ) }  
try {  inFile = new SmbFileInputStream( "smb://MIKE-PC/" );  }  
catch (SmbException e)          {  ListItems.add("SMB Error");  }  
catch (MalformedURLException e) {  ListItems.add("URL Error");  }  
catch (UnknownHostException e)  {  ListItems.add("Host Error");  }

Note that on my PC, 192.168.2.2 = //MIKE-PC
And I'm not on a domain, only a local network.
When it aborts, it does not trigger any of the catch statements.
If I comment out the try/catch block it does not abort.

I tried the above code with and without the name and password, and neither worked.

try {  inFile = new SmbFileInputStream( "smb://MIKE-PC_Network:123ABC@Mike-PC/" );  }  

I tried using a folder name instead of computer name, and it didn't work.

I was able to log on with another app, (not java) even though I didn't give it the network name or password.
I suspect I'm giving it the wrong network info.

Am I giving it the correct info in the statements above?

Community
  • 1
  • 1
Humanoid1000
  • 155
  • 2
  • 9

1 Answers1

0

I need to close this question.
The code above has an obvious typo and I need to do some more testing.
The typo is SmbFileInputStream needs a file parameter, not a folder parameter. However, my corrected code still doesn't work, so I'll re-ask sometime later when I narrow this down.

Humanoid1000
  • 155
  • 2
  • 9