473,563 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trying to transfer files to a PDA

Hi-

I'm trying to transfer files directly to a PDA via a Csharp program
I'm writing. Does anyone know how to do this (I obviously can't use
active sync).

Ohh yes, I'm running Vista.

-Thanks

-Dan

Jul 25 '07 #1
4 8260
Dan,

Why can't you use Active Sync? Is it because the PDA doesn't support
it? If this is the case, then you will most likely have to use an SDK for
the specific product.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

<Da***********@ gmail.comwrote in message
news:11******** **************@ x40g2000prg.goo glegroups.com.. .
Hi-

I'm trying to transfer files directly to a PDA via a Csharp program
I'm writing. Does anyone know how to do this (I obviously can't use
active sync).

Ohh yes, I'm running Vista.

-Thanks

-Dan

Jul 25 '07 #2
On Jul 25, 8:46 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
Dan,

Why can't you use Active Sync? Is it because the PDA doesn't support
it? If this is the case, then you will most likely have to use an SDK for
the specific product.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard .caspershouse.c om

<DanielGiff...@ gmail.comwrote in message

news:11******** **************@ x40g2000prg.goo glegroups.com.. .
Hi-
I'm trying to transfer files directly to a PDA via a Csharp program
I'm writing. Does anyone know how to do this (I obviously can't use
active sync).
Ohh yes, I'm running Vista.
-Thanks
-Dan- Hide quoted text -

- Show quoted text -
I can't use active sync becasue I'm trying to transfer over files to
places that active sync won't let me. I need to do this via my
program. Also, activesync doesn't exactly exist for vista (though
there is a new program that basically does the same thing).

Jul 25 '07 #3
Hi,

Yes, of course, you have to use RAPI.

Here is the code to copy a file

public static void CopyFileToPDA(s tring localfile, string remotefile)
{
//First Copy the executable
int fileh= RAPI.CeCreateFi le(remotefile, RAPI.GENERIC_WR ITE, 0, 0,
RAPI.CREATE_ALW AYS, RAPI.FILE_ATTRI BUTE_NORMAL, 0);
if ( fileh == 0)
throw new Exception("Erro r Creating Remote File : " );
FileStream reader = new FileStream(loca lfile,FileMode. Open);
byte[] buff = new Byte[ 400096];
int readed = 0;
int written=0;
while( (readed=reader. Read( buff, 0, 400096))>0)
RAPI.CeWriteFil e( fileh, buff, readed, out written, 0);
RAPI.CeCloseHan dle( fileh);
reader.Close();

}

public static void RapiInit()
{
try
{
if ( !isRAPIOpen)
CeRapiInit ();
isRAPIOpen = true;
}
catch(Exception e)
{
isRAPIOpen = false;
}
}
public static void RapiUninit ()
{
if ( isRAPIOpen )
CeRapiUninit();
isRAPIOpen = false;
}

These are the p/invoke that you need.

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeDeleteFile(st ring remotefile);

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeCloseHandle(i nt hObject);

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeCreateFile(st ring lpFileName,uint
dwDesiredAccess ,int dwShareMode,int lpSecurityAttri butes,int
dwCreationDispo sition,int dwFlagsAndAttri butes,int hTemplateFile);

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeRapiInitEx ([MarshalAs(Unman agedType.Struct )]
ref RAPIINIT pRapiInit);

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
protected static extern int CeRapiInit ();

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
protected static extern int CeRapiUninit ();

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeReadFile(int hFile,byte[] lpBuffer,int
nNumberOfbytesT oRead, out int lpNumberOfbytes Read, int lpOverlapped);

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeWriteFile(int hFile,byte[] buffer, int
nNumberOfbytesT oWrite, out int lpNumberOfbytes Written, int lpOverlapped);

[DllImport("rapi .dll", CharSet=CharSet .Unicode)]
public static extern int CeGetLastError( );

<Da***********@ gmail.comwrote in message
news:11******** **************@ x40g2000prg.goo glegroups.com.. .
Hi-

I'm trying to transfer files directly to a PDA via a Csharp program
I'm writing. Does anyone know how to do this (I obviously can't use
active sync).

Ohh yes, I'm running Vista.

-Thanks

-Dan

Jul 25 '07 #4
Hi,

<Da***********@ gmail.comwrote in message
news:11******** **************@ z28g2000prd.goo glegroups.com.. .
On Jul 25, 8:46 am, "Nicholas Paldino [.NET/C# MVP]"
<m...@spam.guar d.caspershouse. comwrote:
>Dan,

Why can't you use Active Sync? Is it because the PDA doesn't support
it? If this is the case, then you will most likely have to use an SDK
for
the specific product.

--
- Nicholas Paldino [.NET/C# MVP]
- m...@spam.guard .caspershouse.c om

<DanielGiff... @gmail.comwrote in message

news:11******* *************** @x40g2000prg.go oglegroups.com. ..
Hi-
I'm trying to transfer files directly to a PDA via a Csharp program
I'm writing. Does anyone know how to do this (I obviously can't use
active sync).
Ohh yes, I'm running Vista.
-Thanks
-Dan- Hide quoted text -

- Show quoted text -

I can't use active sync becasue I'm trying to transfer over files to
places that active sync won't let me. I need to do this via my
program. Also, activesync doesn't exactly exist for vista (though
there is a new program that basically does the same thing).
I personally have never used ActiveSync, I use RAPI, if you go to
opennetcf.org you will see an extensive list of libraries you can use to
develop apps for PPC
Jul 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1789
by: Danny | last post by:
Hi all, I am using the Internet Data Transfer Library to ftp files to another server: http://www.mvps.org/access/modules/mdl0037.htm it works fine ftping to another server, but I cannot ftp from any server. I get an error that says cannot transfer file from ftp server. It is a runtime error and there are just a few references to it on...
4
2135
by: Weston Weems | last post by:
I've got the simple problem where I'd like to transfer somewhat large files to my webserver via http/webservice/something like that. My question is what kinda limits have people been able to hit? Is 500mb unreasonable or not. Client doesnt have to be a typical webbrowser, so I could theoretically chunk it up and send chunks to the server,...
1
7803
by: henrycortezwu | last post by:
Hi All, I'd like to transfer files from a Desktop computer to my Cellphone/PDA using VB.NET I've research a bit on this, and I found that I would need to do it using OBEX via Serial Bluetooth COM Port. I've read that using OpenNetCF Serial component will make things easier coding things up because as of the moment there is no Serial...
8
3880
by: bryan | last post by:
I've got a custom HttpHandler to process all requests for a given extension. It gets invoked OK, but if I try to do a Server.Transfer I get an HttpException. A Response.Redirect works, but I really need to avoid the extra round-trip to the client. I've tried Passing the page name, the full URL, and the instance of the handler class to the...
11
2432
by: E.T. Grey | last post by:
Hi, I have an interesting problem. I have a (LARGE) set of historical data that I want to keep on a central server, as several separate files. I want a client process to be able to request the data in a specific file by specifying the file name, start date/time and end date/time. The files are in binary format, to conserve space on the...
1
2503
by: maz01 | last post by:
Hello All, I am developing an application in visual basic 2005 that will run continuously in the background on a users workstation. This application will automatically transfer files from the local machine to a remote server and vise versa. It checks for the files on a timed interval. I have two problems with this application that I am...
2
16791
yashg
by: yashg | last post by:
I am building a data backup application in C# using Sockets. It has a server component and a client component. The client is going to upload files to the server through TCP sockets. I've got all figured out and have been able to transfer files between client and server. Now I have some doubts about which is the best method to transfer a file?...
0
1688
by: vasikaran | last post by:
Hi , i hava one ftp script in batch file programming , ftp script is working fine.. but my is i dont know how much files and what are files avaiulable in remote folder ,,,, if any errors or failures occurring in ftp process how to trace failure files... everything in batch file script only... this is my ftp script ... @ echo off
1
5577
by: shyaminf | last post by:
hi everybody! iam facing a problem with the transfer of file using servlet programming. i have a code for uploading a file. but i'm unable to execute it using tomcat5.5 server. kindly help me how to execute it using tomcat server5.5. the code is as follows. if you have any other coding regarding this, please send me.it's urgent. import...
0
7664
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7583
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7885
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1198
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
923
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.