Smartphone accessing files from shared network folder

  • Thread starter Roman Mellenberger
  • Start date
R

Roman Mellenberger

Is it possible to to open files from a shared network folder?
The following code works with local files but not in the network
folder:

public static string testRead()
{
string str = @"\\192.168.0.25\daten\test.txt";
//string str = @"\storage card\test.txt";

try
{
using (StreamReader srD = new
StreamReader(str))
{
return srD.ReadLine();
}
}
catch (Exception ex)
{
return "Could not read file " +
ex.Message;
}
}

Thanks
Roman
 
P

Paul G. Tobey [eMVP]

Not by IP addresss, no. If you are connected to a LAN where Microsoft file
sharing works (SMB), you can, at least, map a network share
(\\machinename\sharename), to the CE device. Once you've done that, it will
appear as a folder under \Network, where you can open it. I don't think
I've ever tried to open a file itself directly over the network without
first mapping the share to the local file system, but it definitely won't
work with an IP address. You could try a machine name and see...

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top