|
|
|
date: Tue, 8 Jul 2008 05:38:05 -0700,
group: microsoft.public.dotnet.framework.compactframework
back
Re: File Transfer
Hi Paul,
Ok!! Sorry for not providing the complete info. Anyways, the code should
be executed on the device. I would like to transfer a file from the device to
my PC. I just copy command in a .cmd file to transfer teh file and that
worked fine. But when i tried to do it programmatically using File.Copy
function it said "Could not find a part of the path
'\\machinename\\directory' " This is one scenario i tried.
The other was created a batch file to copy the file across and tried to
execute it using Process.Start. It works fine but it prompts for the
username, password and domain. I would like to enter these details in the
program itself. But as far as i know Compact framework doesnt support
ProcessStartInfo.Username and ProcessStartInfo.Password .
Is there any other way to achieve this?
"Paul G. Tobey [eMVP]" wrote:
> Oh come on! Ended in "error"? What error?! "the copy command"? Where is
> the code doing the transfer, on the device or on the PC? It sounds like
> it's on the device, but we can't look over your shoulder and see the code,
> so you must tell us everything that we need to know to understand what
> you're doing...
>
> Paul T.
>
> "Ganesha" wrote in message
> news:DA9F819F-A515-4459-BD2A-10DD1CB64387@microsoft.com...
> > Hi,
> > I have CASIO IT 600 device which has Windows CE 5.0 installed on it. I
> > would like to tranfer file/data from the device to a PC on network. I have
> > set the username, password & domain in ControlPanel-->Owner. If i use the
> > copy command it works fine. But i would like to do it programmatically
> > using
> > C#. I used File.Copy. But that ended up with error. Can anyone please let
> > me
> > know how to specify the credentials and do a file tranfer from my device
> > to
> > the PC programmatically.
> >
> > Thanks,
>
>
>
date: Tue, 8 Jul 2008 08:12:01 -0700
author: Ganesha
Re: File Transfer
It appears to me that the API call CopyFile() does the right thing,
although, of course, it will prompt for user name and password, if it
doesn't know them. That would be set on the Owner Control Panel applet's
Network ID tab.
I think that your main problem is probably that copying the file does *NOT*
assume that, if you list a folder as the destination, you want the same
filename as the source. You need to specify a source filename and a
destination *filename*, not path.
Paul T.
"Ganesha" wrote in message
news:5E21734E-D6BA-48F0-9BB6-7E47C4994E27@microsoft.com...
> Hi Paul,
> Ok!! Sorry for not providing the complete info. Anyways, the code
> should
> be executed on the device. I would like to transfer a file from the device
> to
> my PC. I just copy command in a .cmd file to transfer teh file and that
> worked fine. But when i tried to do it programmatically using File.Copy
> function it said "Could not find a part of the path
> '\\machinename\\directory' " This is one scenario i tried.
>
> The other was created a batch file to copy the file across and tried to
> execute it using Process.Start. It works fine but it prompts for the
> username, password and domain. I would like to enter these details in the
> program itself. But as far as i know Compact framework doesnt support
> ProcessStartInfo.Username and ProcessStartInfo.Password .
>
> Is there any other way to achieve this?
>
>
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> Oh come on! Ended in "error"? What error?! "the copy command"? Where
>> is
>> the code doing the transfer, on the device or on the PC? It sounds like
>> it's on the device, but we can't look over your shoulder and see the
>> code,
>> so you must tell us everything that we need to know to understand what
>> you're doing...
>>
>> Paul T.
>>
>> "Ganesha" wrote in message
>> news:DA9F819F-A515-4459-BD2A-10DD1CB64387@microsoft.com...
>> > Hi,
>> > I have CASIO IT 600 device which has Windows CE 5.0 installed on it. I
>> > would like to tranfer file/data from the device to a PC on network. I
>> > have
>> > set the username, password & domain in ControlPanel-->Owner. If i use
>> > the
>> > copy command it works fine. But i would like to do it programmatically
>> > using
>> > C#. I used File.Copy. But that ended up with error. Can anyone please
>> > let
>> > me
>> > know how to specify the credentials and do a file tranfer from my
>> > device
>> > to
>> > the PC programmatically.
>> >
>> > Thanks,
>>
>>
>>
date: Tue, 8 Jul 2008 08:57:31 -0700
author: Paul G. Tobey [eMVP] p space tobey no spam AT no instrument no spam DOT com
Re: File Transfer
I dont want to go to owner applet in control panel and manually set the
username and password. Is there a way to specify those parameteres
programmatically and then transfer a file??
Thanks
"Paul G. Tobey [eMVP]" wrote:
> It appears to me that the API call CopyFile() does the right thing,
> although, of course, it will prompt for user name and password, if it
> doesn't know them. That would be set on the Owner Control Panel applet's
> Network ID tab.
>
> I think that your main problem is probably that copying the file does *NOT*
> assume that, if you list a folder as the destination, you want the same
> filename as the source. You need to specify a source filename and a
> destination *filename*, not path.
>
> Paul T.
>
> "Ganesha" wrote in message
> news:5E21734E-D6BA-48F0-9BB6-7E47C4994E27@microsoft.com...
> > Hi Paul,
> > Ok!! Sorry for not providing the complete info. Anyways, the code
> > should
> > be executed on the device. I would like to transfer a file from the device
> > to
> > my PC. I just copy command in a .cmd file to transfer teh file and that
> > worked fine. But when i tried to do it programmatically using File.Copy
> > function it said "Could not find a part of the path
> > '\\machinename\\directory' " This is one scenario i tried.
> >
> > The other was created a batch file to copy the file across and tried to
> > execute it using Process.Start. It works fine but it prompts for the
> > username, password and domain. I would like to enter these details in the
> > program itself. But as far as i know Compact framework doesnt support
> > ProcessStartInfo.Username and ProcessStartInfo.Password .
> >
> > Is there any other way to achieve this?
> >
> >
> >
> > "Paul G. Tobey [eMVP]" wrote:
> >
> >> Oh come on! Ended in "error"? What error?! "the copy command"? Where
> >> is
> >> the code doing the transfer, on the device or on the PC? It sounds like
> >> it's on the device, but we can't look over your shoulder and see the
> >> code,
> >> so you must tell us everything that we need to know to understand what
> >> you're doing...
> >>
> >> Paul T.
> >>
> >> "Ganesha" wrote in message
> >> news:DA9F819F-A515-4459-BD2A-10DD1CB64387@microsoft.com...
> >> > Hi,
> >> > I have CASIO IT 600 device which has Windows CE 5.0 installed on it. I
> >> > would like to tranfer file/data from the device to a PC on network. I
> >> > have
> >> > set the username, password & domain in ControlPanel-->Owner. If i use
> >> > the
> >> > copy command it works fine. But i would like to do it programmatically
> >> > using
> >> > C#. I used File.Copy. But that ended up with error. Can anyone please
> >> > let
> >> > me
> >> > know how to specify the credentials and do a file tranfer from my
> >> > device
> >> > to
> >> > the PC programmatically.
> >> >
> >> > Thanks,
> >>
> >>
> >>
>
>
>
date: Tue, 8 Jul 2008 09:19:12 -0700
author: Ganesha
Re: File Transfer
There's no easy way. You could map the network share, the equivalent of
doing 'net use * \\<server>\\<share> /user:<user> /password:<password>'
using a P/Invoke of WNetAddConnection3, then copy the file to the local
mapping of the remote server, then disconnect from the share.
If you want to know how to set the default credentials, you'll have to read
the code for the Owner Control Panel applet and see what they're doing.
owner.cpp is what you're looking for. CacheDomainCredential() is, I think,
the main answer. Again, P/Invoke.
Paul T.
"Ganesha" wrote in message
news:B39C29DA-3BA5-4B71-8CDF-D3233C6B116D@microsoft.com...
>I dont want to go to owner applet in control panel and manually set the
> username and password. Is there a way to specify those parameteres
> programmatically and then transfer a file??
>
> Thanks
>
> "Paul G. Tobey [eMVP]" wrote:
>
>> It appears to me that the API call CopyFile() does the right thing,
>> although, of course, it will prompt for user name and password, if it
>> doesn't know them. That would be set on the Owner Control Panel applet's
>> Network ID tab.
>>
>> I think that your main problem is probably that copying the file does
>> *NOT*
>> assume that, if you list a folder as the destination, you want the same
>> filename as the source. You need to specify a source filename and a
>> destination *filename*, not path.
>>
>> Paul T.
>>
>> "Ganesha" wrote in message
>> news:5E21734E-D6BA-48F0-9BB6-7E47C4994E27@microsoft.com...
>> > Hi Paul,
>> > Ok!! Sorry for not providing the complete info. Anyways, the code
>> > should
>> > be executed on the device. I would like to transfer a file from the
>> > device
>> > to
>> > my PC. I just copy command in a .cmd file to transfer teh file and that
>> > worked fine. But when i tried to do it programmatically using File.Copy
>> > function it said "Could not find a part of the path
>> > '\\machinename\\directory' " This is one scenario i tried.
>> >
>> > The other was created a batch file to copy the file across and tried to
>> > execute it using Process.Start. It works fine but it prompts for the
>> > username, password and domain. I would like to enter these details in
>> > the
>> > program itself. But as far as i know Compact framework doesnt support
>> > ProcessStartInfo.Username and ProcessStartInfo.Password .
>> >
>> > Is there any other way to achieve this?
>> >
>> >
>> >
>> > "Paul G. Tobey [eMVP]" wrote:
>> >
>> >> Oh come on! Ended in "error"? What error?! "the copy command"?
>> >> Where
>> >> is
>> >> the code doing the transfer, on the device or on the PC? It sounds
>> >> like
>> >> it's on the device, but we can't look over your shoulder and see the
>> >> code,
>> >> so you must tell us everything that we need to know to understand what
>> >> you're doing...
>> >>
>> >> Paul T.
>> >>
>> >> "Ganesha" wrote in message
>> >> news:DA9F819F-A515-4459-BD2A-10DD1CB64387@microsoft.com...
>> >> > Hi,
>> >> > I have CASIO IT 600 device which has Windows CE 5.0 installed on it.
>> >> > I
>> >> > would like to tranfer file/data from the device to a PC on network.
>> >> > I
>> >> > have
>> >> > set the username, password & domain in ControlPanel-->Owner. If i
>> >> > use
>> >> > the
>> >> > copy command it works fine. But i would like to do it
>> >> > programmatically
>> >> > using
>> >> > C#. I used File.Copy. But that ended up with error. Can anyone
>> >> > please
>> >> > let
>> >> > me
>> >> > know how to specify the credentials and do a file tranfer from my
>> >> > device
>> >> > to
>> >> > the PC programmatically.
>> >> >
>> >> > Thanks,
>> >>
>> >>
>> >>
>>
>>
>>
date: Tue, 8 Jul 2008 09:35:52 -0700
author: Paul G. Tobey [eMVP] p space tobey no spam AT no instrument no spam DOT com
|
|