Copying and manipulating files between the device and the host computer

R

Robert Holmes

I have been researching this issue for almost two weeks now I need to be
able to access xm files on a specfic folder on the host computer, make some
changes, then send another back to another folder off the parent of the
first. It is a relacement for an existing Palm application, and we are not
in a position to make changes to the systems generating and reading these
files, so the locations of the files is more or less fixed.

My problem is that I have not been able to find a way to read files from the
host machine, rename those files, then write back files to a specific folder
on the host. I know that I can use the SNAPI interface to know when the
device is cradled, or otherwise connected, but have not found in either the
compact framework, or the windows mobile 5.0 stuff, how to read from the
host machine. For example I tried to check the check the host by creating a
DirectoryInfo object passing in @"C:\" within the consructor but it did not
see the c drive of the host machine. I have only been able to see the
device's file system.

I have also looked into the Mobile Software Factory tools. The Connection
Monitor allows me to see what networks are available, however I do not see
where I can manipulate the file systems that I discover via that mechanism.

I am sure that the solution is staring me in the face, but I just don't see
it.

Thanks in advance for any help.
 
C

chris-s

Why not try something simple like sharing the folder on the pc and then
accessing it like
"\\<host-pc-name-or-ip>\<shared-folder-name>\<file-name"

Of course you need to ensure that you allow full access to the
folder\files.

A slightly more complicated alternative might be to use write some web
services.

Chris
 
R

Robert Holmes

Chris,

That should work fine, thanks. Like I said I knew I was staring me in the
face. The one possible wrinkle is that I do need to be somewhat security
conscious, so that I cannot give full control to Everyone to that folder.
Therefore I will need to know the user name that the device will use, and
give permissions to that user. In addition it will go out to approx 1000
users, so it is not a process that cannot be done manually, but will need to
be a part of the setup.

Thanks again Chris.
 
R

Robert Holmes

Actually that didn;t work. I tried this:

if (IO.Directory.Exists(machineFolder))

MessageBox.Show("Huzzah");

else

MessageBox.Show("Too Bad!");

if (IO.File.Exists(machineFolder + @"\OrderId515369Upload.txt"))

MessageBox.Show("Bully!");

else

MessageBox.Show("That sucks!");

where machineFolder is the unc path to the share on the host computer. Every
time I run this, and I have tried numerous variations, on the emulator, I
get back the message that it does not exist. Currently Everyone has full
control over the folder.

any thoughts?
 

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