i want to copy all files in PDA using NETCF.Desktop.Communication

G

Guest

hi iam using vs 2003 .net CF 1

i want to copy all xml files from a particular directory(in PDA) to Desktop
directory

but i know only one file to copy....

Imports OpenNETCF.Desktop.Communication
myrapi.CopyFileFromDevice(Label1.Text, "C:\sdf\DownloadXML\a.xml")

i have list of files in pda
how to copy....
thanks
 
M

Markus Humm

rt said:
hi iam using vs 2003 .net CF 1

i want to copy all xml files from a particular directory(in PDA) to Desktop
directory

but i know only one file to copy....

Imports OpenNETCF.Desktop.Communication
myrapi.CopyFileFromDevice(Label1.Text, "C:\sdf\DownloadXML\a.xml")

i have list of files in pda
how to copy....
thanks
Loop at your list with each loop sending one file.

Greetings

Markus
 
G

Guest

But how to get a list file names(PDA).
and how to loop it...

pls provide code for me

thanks
 
N

Norman Rericha

You will have to do the following

1) Get all the "objects" in the directory (Directory.GetFiles())
2) Determine if the "object" is a directory or a file
3a) If it is a directory, goto 1
3b) If its a file, copy it over.

This will be a recursive function.

I think you should be able to write the code from there. Be warned
however, that "Every" file can not be copied since several are in the
ROM and might not be able to be copied.


--
I hope this helps

--
Norman Rericha
Senior Software Engineer
Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member
 
G

Guest

hi could you pls help me

Imports OpenNETCF.Desktop.Communication
myrapi.CopyFileFromDevice(\\program files\smf\IPA\ , "C:\sdf\DownloadXML\")


for the above i dont know how man files in the IPA folder of PDA
and want to transfer to desktop

pls give some code...
i cant get help from OpenNETCF.Desktop.Communication library.

thanks
 
G

Guest

Use the RAPI.EnumFiles method first, which will return a FileList
collection, then iterate through it copying each.

-Chris
 
G

Guest

Try
' Connect to the device.
myrapi.Connect()
Do While Not myrapi.DevicePresent
MessageBox.Show("Please connect your device to your PC using
ActiveSync and " & _
"before clicking the OK button.", "No Device Present")
myrapi.Connect()
Loop

Catch ex As Exception
MessageBox.Show("The following error occurred while attempting
to connect to" & _
" your device - " & ex.Message, "Connection Error")
Application.Exit()
End Try

Try
Dim f As FileList = myrapi.EnumFiles("\program
files\SmartDeviceApplication3\InspectionFiles\*")
Dim i As Integer

For i = 0 To f.Count - 1
'ListBox1.Items.Add(f(i).FileName)
'ListBox1.Items.Add(myrapi.DeviceFileExists("\program
files\SmartDeviceApplication3\InspectionFiles\" & f(i).FileName))
myrapi.CopyFileFromDevice("\program
files\SmartDeviceApplication3\InspectionFiles\" & f(i).FileName,
"C:\xxsd\DownloadXML\" & f(i).FileName & ".xml")

'myrapi.CopyFileFromDevice("\program
files\SmartDeviceApplication3\InspectionFiles\" & f(i).FileName, "C:\" &
f(i).FileName)



Next


MessageBox.Show("Your file has been copied.", "Copy Success")
Catch ex As RAPIException
MessageBox.Show(ex.Message)
End Try





iam getting error message
could not open remote file, iam getting the list of file names,
but could not copy????

help me
 
G

Guest

hi,

my xml files like some A141F 84604c4c-ff99-4e70-836a-b4c80d0c1b04.xml
in (pda), iam try to copy.
when i run vb.net windows forms, application exit, it does not copy
not give error


but i can copy same name files like name a.xml, b.xml, but not the big
namefiles...
L144A 4a43f6d0-a3b4-4914-8eca-eba0cbaabed6.xml

Try
Dim f As FileList = myrapi.EnumFiles("\program
files\SmartDeviceApplication3\InspectionFiles\*.xml")
Dim i As Integer
For i = 0 To f.Count - 1
ListBox1.Items.Add(f(i).FileName)
myrapi.CopyFileFromDevice("C:\sd\DownloadXML\" &
f(i).FileName, "\program files\SmartDeviceApplication3\InspectionFiles\" &
f(i).FileName)
Next
MessageBox.Show("Your file has been copied.", "Copy Success")
Catch ex As RAPIException
MessageBox.Show(ex.Message)

End Try
 

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