PC Review


Reply
Thread Tools Rate Thread

How do you move files around using VB.net ?

 
 
Rob
Guest
Posts: n/a
 
      27th Jun 2006
I need to move some files to different folders. How would you do it within
compact framework ? File system object work here ?

Thanks


 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      27th Jun 2006
There is no FSO in CE, and in VB.NET on the desktop it's still the wrong way
to go. Look at the System.IO namespace. File.Move is probably what you're
after.

-Chris


"Rob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I need to move some files to different folders. How would you do it
>within compact framework ? File system object work here ?
>
> Thanks
>



 
Reply With Quote
 
Rob
Guest
Posts: n/a
 
      27th Jun 2006
I simply want to copy a file....

str1 = \\My Device\My Documents\Folder1\orders.xml"

to

str2 = \\My Device\Program Files\Folder2\orders.xml"

File.Copy (str1,str2)

But I get an exception error that disappears faster than I can read it...

Thanks !


"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
news:(E-Mail Removed)...
> There is no FSO in CE, and in VB.NET on the desktop it's still the wrong
> way to go. Look at the System.IO namespace. File.Move is probably what
> you're after.
>
> -Chris
>
>
> "Rob" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I need to move some files to different folders. How would you do it
>>within compact framework ? File system object work here ?
>>
>> Thanks
>>

>
>



 
Reply With Quote
 
Bipin_Expert
Guest
Posts: n/a
 
      27th Jun 2006
Hi
Please try changing as below:

str1 ="\My Device\My Documents\Folder1\orders.xml"
str2 = "\My Device\Program Files\Folder2\orders.xml"
File.Copy (str1,str2)

As we reference path starting with single slash and your code shows
double slashes.
Also please take care that Folder1 and Folder2 exists in respective
paths.

Regards,
Bipin Kesharwani
(Developer)

Palewar Techno Solutions
Pocket PC & Mobile Software Development
Nagpur, India

http://www.palewar.com



Rob wrote:
> I simply want to copy a file....
>
> str1 = \\My Device\My Documents\Folder1\orders.xml"
>
> to
>
> str2 = \\My Device\Program Files\Folder2\orders.xml"
>
> File.Copy (str1,str2)
>
> But I get an exception error that disappears faster than I can read it...
>
> Thanks !
>
>
> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
> news:(E-Mail Removed)...
> > There is no FSO in CE, and in VB.NET on the desktop it's still the wrong
> > way to go. Look at the System.IO namespace. File.Move is probably what
> > you're after.
> >
> > -Chris
> >
> >
> > "Rob" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> >>I need to move some files to different folders. How would you do it
> >>within compact framework ? File system object work here ?
> >>
> >> Thanks
> >>

> >
> >


 
Reply With Quote
 
Rob
Guest
Posts: n/a
 
      27th Jun 2006
Thanks, but that is still not working....

I added code to test for file exists... I am absolutely sure that the file
DOES exist. Could there be a problem with the spaces between the words "My
Device" etc. ?

Any other suggestions ?


"Bipin_Expert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
> Please try changing as below:
>
> str1 ="\My Device\My Documents\Folder1\orders.xml"
> str2 = "\My Device\Program Files\Folder2\orders.xml"
> File.Copy (str1,str2)
>
> As we reference path starting with single slash and your code shows
> double slashes.
> Also please take care that Folder1 and Folder2 exists in respective
> paths.
>
> Regards,
> Bipin Kesharwani
> (Developer)
>
> Palewar Techno Solutions
> Pocket PC & Mobile Software Development
> Nagpur, India
>
> http://www.palewar.com
>
>
>
> Rob wrote:
>> I simply want to copy a file....
>>
>> str1 = \\My Device\My Documents\Folder1\orders.xml"
>>
>> to
>>
>> str2 = \\My Device\Program Files\Folder2\orders.xml"
>>
>> File.Copy (str1,str2)
>>
>> But I get an exception error that disappears faster than I can read it...
>>
>> Thanks !
>>
>>
>> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
>> news:(E-Mail Removed)...
>> > There is no FSO in CE, and in VB.NET on the desktop it's still the
>> > wrong
>> > way to go. Look at the System.IO namespace. File.Move is probably
>> > what
>> > you're after.
>> >
>> > -Chris
>> >
>> >
>> > "Rob" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> >>I need to move some files to different folders. How would you do it
>> >>within compact framework ? File system object work here ?
>> >>
>> >> Thanks
>> >>
>> >
>> >

>



 
Reply With Quote
 
Guest
Posts: n/a
 
      27th Jun 2006
You cannot copy from the device to the desktop like this. I've answered
this in your other post of the same question (which is bad form I might
add).

-Chris


"Rob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks, but that is still not working....
>
> I added code to test for file exists... I am absolutely sure that the file
> DOES exist. Could there be a problem with the spaces between the words
> "My Device" etc. ?
>
> Any other suggestions ?
>
>
> "Bipin_Expert" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi
>> Please try changing as below:
>>
>> str1 ="\My Device\My Documents\Folder1\orders.xml"
>> str2 = "\My Device\Program Files\Folder2\orders.xml"
>> File.Copy (str1,str2)
>>
>> As we reference path starting with single slash and your code shows
>> double slashes.
>> Also please take care that Folder1 and Folder2 exists in respective
>> paths.
>>
>> Regards,
>> Bipin Kesharwani
>> (Developer)
>>
>> Palewar Techno Solutions
>> Pocket PC & Mobile Software Development
>> Nagpur, India
>>
>> http://www.palewar.com
>>
>>
>>
>> Rob wrote:
>>> I simply want to copy a file....
>>>
>>> str1 = \\My Device\My Documents\Folder1\orders.xml"
>>>
>>> to
>>>
>>> str2 = \\My Device\Program Files\Folder2\orders.xml"
>>>
>>> File.Copy (str1,str2)
>>>
>>> But I get an exception error that disappears faster than I can read
>>> it...
>>>
>>> Thanks !
>>>
>>>
>>> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
>>> news:(E-Mail Removed)...
>>> > There is no FSO in CE, and in VB.NET on the desktop it's still the
>>> > wrong
>>> > way to go. Look at the System.IO namespace. File.Move is probably
>>> > what
>>> > you're after.
>>> >
>>> > -Chris
>>> >
>>> >
>>> > "Rob" <(E-Mail Removed)> wrote in message
>>> > news:(E-Mail Removed)...
>>> >>I need to move some files to different folders. How would you do it
>>> >>within compact framework ? File system object work here ?
>>> >>
>>> >> Thanks
>>> >>
>>> >
>>> >

>>

>
>



 
Reply With Quote
 
Rob
Guest
Posts: n/a
 
      27th Jun 2006
No, this is all done on the handheld 100%....


"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
news:(E-Mail Removed)...
> You cannot copy from the device to the desktop like this. I've answered
> this in your other post of the same question (which is bad form I might
> add).
>
> -Chris
>
>
> "Rob" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Thanks, but that is still not working....
>>
>> I added code to test for file exists... I am absolutely sure that the
>> file DOES exist. Could there be a problem with the spaces between the
>> words "My Device" etc. ?
>>
>> Any other suggestions ?
>>
>>
>> "Bipin_Expert" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi
>>> Please try changing as below:
>>>
>>> str1 ="\My Device\My Documents\Folder1\orders.xml"
>>> str2 = "\My Device\Program Files\Folder2\orders.xml"
>>> File.Copy (str1,str2)
>>>
>>> As we reference path starting with single slash and your code shows
>>> double slashes.
>>> Also please take care that Folder1 and Folder2 exists in respective
>>> paths.
>>>
>>> Regards,
>>> Bipin Kesharwani
>>> (Developer)
>>>
>>> Palewar Techno Solutions
>>> Pocket PC & Mobile Software Development
>>> Nagpur, India
>>>
>>> http://www.palewar.com
>>>
>>>
>>>
>>> Rob wrote:
>>>> I simply want to copy a file....
>>>>
>>>> str1 = \\My Device\My Documents\Folder1\orders.xml"
>>>>
>>>> to
>>>>
>>>> str2 = \\My Device\Program Files\Folder2\orders.xml"
>>>>
>>>> File.Copy (str1,str2)
>>>>
>>>> But I get an exception error that disappears faster than I can read
>>>> it...
>>>>
>>>> Thanks !
>>>>
>>>>
>>>> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
>>>> news:(E-Mail Removed)...
>>>> > There is no FSO in CE, and in VB.NET on the desktop it's still the
>>>> > wrong
>>>> > way to go. Look at the System.IO namespace. File.Move is probably
>>>> > what
>>>> > you're after.
>>>> >
>>>> > -Chris
>>>> >
>>>> >
>>>> > "Rob" <(E-Mail Removed)> wrote in message
>>>> > news:(E-Mail Removed)...
>>>> >>I need to move some files to different folders. How would you do it
>>>> >>within compact framework ? File system object work here ?
>>>> >>
>>>> >> Thanks
>>>> >>
>>>> >
>>>> >
>>>

>>
>>

>
>



 
Reply With Quote
 
Rob
Guest
Posts: n/a
 
      27th Jun 2006
Chris,

Here is the code I am running All of which is on the handheld.... there is
no copy to or from the Desktop invlolved. (That was an earlier and
different question.)

When I use File Explorer on the handheld I know that the files do exist on
the handheld, yet I get the "File NO Exists" error.



strFilePathOrdersBOD = "\My Device\My
Documents\ZSampleApp\ToHandheld\Orders.xml"

strFIlePathOrdersLive = "\My Device\Program Files\ZTest1\Orders.xml"

If File.Exists(strFilePathOrdersBOD) Then

MsgBox(strFilePathOrdersBOD & " - File Exists")

Else

MsgBox(strFilePathOrdersBOD & " - File NO Exists")

End If

If File.Exists(strFIlePathOrdersLive) Then

MsgBox(strFIlePathOrdersLive & " - File Exists")

Else

MsgBox(strFIlePathOrdersLive & " - File NO Exists")

End If




"<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
news:(E-Mail Removed)...
> You cannot copy from the device to the desktop like this. I've answered
> this in your other post of the same question (which is bad form I might
> add).
>
> -Chris
>
>
> "Rob" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Thanks, but that is still not working....
>>
>> I added code to test for file exists... I am absolutely sure that the
>> file DOES exist. Could there be a problem with the spaces between the
>> words "My Device" etc. ?
>>
>> Any other suggestions ?
>>
>>
>> "Bipin_Expert" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Hi
>>> Please try changing as below:
>>>
>>> str1 ="\My Device\My Documents\Folder1\orders.xml"
>>> str2 = "\My Device\Program Files\Folder2\orders.xml"
>>> File.Copy (str1,str2)
>>>
>>> As we reference path starting with single slash and your code shows
>>> double slashes.
>>> Also please take care that Folder1 and Folder2 exists in respective
>>> paths.
>>>
>>> Regards,
>>> Bipin Kesharwani
>>> (Developer)
>>>
>>> Palewar Techno Solutions
>>> Pocket PC & Mobile Software Development
>>> Nagpur, India
>>>
>>> http://www.palewar.com
>>>
>>>
>>>
>>> Rob wrote:
>>>> I simply want to copy a file....
>>>>
>>>> str1 = \\My Device\My Documents\Folder1\orders.xml"
>>>>
>>>> to
>>>>
>>>> str2 = \\My Device\Program Files\Folder2\orders.xml"
>>>>
>>>> File.Copy (str1,str2)
>>>>
>>>> But I get an exception error that disappears faster than I can read
>>>> it...
>>>>
>>>> Thanks !
>>>>
>>>>
>>>> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
>>>> news:(E-Mail Removed)...
>>>> > There is no FSO in CE, and in VB.NET on the desktop it's still the
>>>> > wrong
>>>> > way to go. Look at the System.IO namespace. File.Move is probably
>>>> > what
>>>> > you're after.
>>>> >
>>>> > -Chris
>>>> >
>>>> >
>>>> > "Rob" <(E-Mail Removed)> wrote in message
>>>> > news:(E-Mail Removed)...
>>>> >>I need to move some files to different folders. How would you do it
>>>> >>within compact framework ? File system object work here ?
>>>> >>
>>>> >> Thanks
>>>> >>
>>>> >
>>>> >
>>>

>>
>>

>
>



 
Reply With Quote
 
Guest
Posts: n/a
 
      27th Jun 2006
"\My Device" should be removed then.

-Chris


"Rob" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Chris,
>
> Here is the code I am running All of which is on the handheld.... there is
> no copy to or from the Desktop invlolved. (That was an earlier and
> different question.)
>
> When I use File Explorer on the handheld I know that the files do exist on
> the handheld, yet I get the "File NO Exists" error.
>
>
>
> strFilePathOrdersBOD = "\My Device\My
> Documents\ZSampleApp\ToHandheld\Orders.xml"
>
> strFIlePathOrdersLive = "\My Device\Program Files\ZTest1\Orders.xml"
>
> If File.Exists(strFilePathOrdersBOD) Then
>
> MsgBox(strFilePathOrdersBOD & " - File Exists")
>
> Else
>
> MsgBox(strFilePathOrdersBOD & " - File NO Exists")
>
> End If
>
> If File.Exists(strFIlePathOrdersLive) Then
>
> MsgBox(strFIlePathOrdersLive & " - File Exists")
>
> Else
>
> MsgBox(strFIlePathOrdersLive & " - File NO Exists")
>
> End If
>
>
>
>
> "<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
> news:(E-Mail Removed)...
>> You cannot copy from the device to the desktop like this. I've answered
>> this in your other post of the same question (which is bad form I might
>> add).
>>
>> -Chris
>>
>>
>> "Rob" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> Thanks, but that is still not working....
>>>
>>> I added code to test for file exists... I am absolutely sure that the
>>> file DOES exist. Could there be a problem with the spaces between the
>>> words "My Device" etc. ?
>>>
>>> Any other suggestions ?
>>>
>>>
>>> "Bipin_Expert" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Hi
>>>> Please try changing as below:
>>>>
>>>> str1 ="\My Device\My Documents\Folder1\orders.xml"
>>>> str2 = "\My Device\Program Files\Folder2\orders.xml"
>>>> File.Copy (str1,str2)
>>>>
>>>> As we reference path starting with single slash and your code shows
>>>> double slashes.
>>>> Also please take care that Folder1 and Folder2 exists in respective
>>>> paths.
>>>>
>>>> Regards,
>>>> Bipin Kesharwani
>>>> (Developer)
>>>>
>>>> Palewar Techno Solutions
>>>> Pocket PC & Mobile Software Development
>>>> Nagpur, India
>>>>
>>>> http://www.palewar.com
>>>>
>>>>
>>>>
>>>> Rob wrote:
>>>>> I simply want to copy a file....
>>>>>
>>>>> str1 = \\My Device\My Documents\Folder1\orders.xml"
>>>>>
>>>>> to
>>>>>
>>>>> str2 = \\My Device\Program Files\Folder2\orders.xml"
>>>>>
>>>>> File.Copy (str1,str2)
>>>>>
>>>>> But I get an exception error that disappears faster than I can read
>>>>> it...
>>>>>
>>>>> Thanks !
>>>>>
>>>>>
>>>>> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
>>>>> news:(E-Mail Removed)...
>>>>> > There is no FSO in CE, and in VB.NET on the desktop it's still the
>>>>> > wrong
>>>>> > way to go. Look at the System.IO namespace. File.Move is probably
>>>>> > what
>>>>> > you're after.
>>>>> >
>>>>> > -Chris
>>>>> >
>>>>> >
>>>>> > "Rob" <(E-Mail Removed)> wrote in message
>>>>> > news:(E-Mail Removed)...
>>>>> >>I need to move some files to different folders. How would you do
>>>>> >>it
>>>>> >>within compact framework ? File system object work here ?
>>>>> >>
>>>>> >> Thanks
>>>>> >>
>>>>> >
>>>>> >
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Rob
Guest
Posts: n/a
 
      27th Jun 2006
Yes, that worked !
Thanks

"<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
news:(E-Mail Removed)...
> "\My Device" should be removed then.
>
> -Chris
>
>
> "Rob" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Chris,
>>
>> Here is the code I am running All of which is on the handheld.... there
>> is no copy to or from the Desktop invlolved. (That was an earlier and
>> different question.)
>>
>> When I use File Explorer on the handheld I know that the files do exist
>> on the handheld, yet I get the "File NO Exists" error.
>>
>>
>>
>> strFilePathOrdersBOD = "\My Device\My
>> Documents\ZSampleApp\ToHandheld\Orders.xml"
>>
>> strFIlePathOrdersLive = "\My Device\Program Files\ZTest1\Orders.xml"
>>
>> If File.Exists(strFilePathOrdersBOD) Then
>>
>> MsgBox(strFilePathOrdersBOD & " - File Exists")
>>
>> Else
>>
>> MsgBox(strFilePathOrdersBOD & " - File NO Exists")
>>
>> End If
>>
>> If File.Exists(strFIlePathOrdersLive) Then
>>
>> MsgBox(strFIlePathOrdersLive & " - File Exists")
>>
>> Else
>>
>> MsgBox(strFIlePathOrdersLive & " - File NO Exists")
>>
>> End If
>>
>>
>>
>>
>> "<ctacke/>" <ctacke_AT_OpenNETCF_com> wrote in message
>> news:(E-Mail Removed)...
>>> You cannot copy from the device to the desktop like this. I've answered
>>> this in your other post of the same question (which is bad form I might
>>> add).
>>>
>>> -Chris
>>>
>>>
>>> "Rob" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>> Thanks, but that is still not working....
>>>>
>>>> I added code to test for file exists... I am absolutely sure that the
>>>> file DOES exist. Could there be a problem with the spaces between the
>>>> words "My Device" etc. ?
>>>>
>>>> Any other suggestions ?
>>>>
>>>>
>>>> "Bipin_Expert" <(E-Mail Removed)> wrote in message
>>>> news:(E-Mail Removed)...
>>>>> Hi
>>>>> Please try changing as below:
>>>>>
>>>>> str1 ="\My Device\My Documents\Folder1\orders.xml"
>>>>> str2 = "\My Device\Program Files\Folder2\orders.xml"
>>>>> File.Copy (str1,str2)
>>>>>
>>>>> As we reference path starting with single slash and your code shows
>>>>> double slashes.
>>>>> Also please take care that Folder1 and Folder2 exists in respective
>>>>> paths.
>>>>>
>>>>> Regards,
>>>>> Bipin Kesharwani
>>>>> (Developer)
>>>>>
>>>>> Palewar Techno Solutions
>>>>> Pocket PC & Mobile Software Development
>>>>> Nagpur, India
>>>>>
>>>>> http://www.palewar.com
>>>>>
>>>>>
>>>>>
>>>>> Rob wrote:
>>>>>> I simply want to copy a file....
>>>>>>
>>>>>> str1 = \\My Device\My Documents\Folder1\orders.xml"
>>>>>>
>>>>>> to
>>>>>>
>>>>>> str2 = \\My Device\Program Files\Folder2\orders.xml"
>>>>>>
>>>>>> File.Copy (str1,str2)
>>>>>>
>>>>>> But I get an exception error that disappears faster than I can read
>>>>>> it...
>>>>>>
>>>>>> Thanks !
>>>>>>
>>>>>>
>>>>>> "<ctacke/>" <ctacke[@]opennetcf[dot]com> wrote in message
>>>>>> news:(E-Mail Removed)...
>>>>>> > There is no FSO in CE, and in VB.NET on the desktop it's still the
>>>>>> > wrong
>>>>>> > way to go. Look at the System.IO namespace. File.Move is probably
>>>>>> > what
>>>>>> > you're after.
>>>>>> >
>>>>>> > -Chris
>>>>>> >
>>>>>> >
>>>>>> > "Rob" <(E-Mail Removed)> wrote in message
>>>>>> > news:(E-Mail Removed)...
>>>>>> >>I need to move some files to different folders. How would you do
>>>>>> >>it
>>>>>> >>within compact framework ? File system object work here ?
>>>>>> >>
>>>>>> >> Thanks
>>>>>> >>
>>>>>> >
>>>>>> >
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copies of files being made when I try to move or delete files Jack Dugrew Windows XP Help 1 16th May 2009 04:15 PM
Re: Can't move emails to different files. Get 'can't move items' Gordon Microsoft Outlook Discussion 0 2nd Jan 2007 02:09 PM
Move C:\Program Files\Common Files To Another Drive =?Utf-8?B?YmFkZXI=?= Windows XP General 5 24th Jun 2005 10:13 PM
Import Files and Move Files from Folder =?Utf-8?B?TWFsbGFzY2g=?= Microsoft Access 6 15th Jun 2005 08:07 PM
users can move subdirectories, accidently how can I prevent with out removing rights to create move files. =?Utf-8?B?Sm9obiBi?= Microsoft Windows 2000 File System 0 26th Jan 2004 06:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:29 PM.