#include "rapi.h"
#pragma comment(lib,"D:\\My Documents\\Visual Studio 2005\\Projects\\copy12\\copy12\\rapi.lib")
//BUFFER_SIZE 1024
void CopyFilePCtoWinCE(CString strFileNamePC, CString strFileNamePPC)
{
CFile oldFile;
oldFile.Open(strFileNamePC, CFile::modeRead |CFile::typeBinary);
int iLen = oldFile.GetLength();
iLen = iLen / BUFFER_SIZE;
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
HANDLE h = CeCreateFile(bstr, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
char cTemp[BUFFER_SIZE];
DWORD nbytes;
int iTotBytes = 0;
int iReaded=0;
while((iReaded=oldFile.Read(&cTemp, BUFFER_SIZE)) >= 1)
CeWriteFile(h, &cTemp, (DWORD)iReaded, &nbytes, NULL);
CeCloseHandle(h);
oldFile.Close();
CeRapiUninit();
}
void CopyFileWinCEtoPC(CString strFileNamePPC, CString strFileNamePC)
{
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
HANDLE h;
h = CeCreateFile(bstr, GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
CFile oldFile;
oldFile.Open(strFileNamePC, CFile::modeCreate | CFile::modeWrite);
char cTemp[BUFFER_SIZE];
DWORD nbytes;
CString s;
while(CeReadFile(h, &cTemp, (DWORD)BUFFER_SIZE, &nbytes, NULL) == TRUE)
{
oldFile.Write(&cTemp, nbytes);
if(nbytes < BUFFER_SIZE)
break;
}
CeCloseHandle(h);
oldFile.Close();
CeRapiUninit();
}
BOOL DeleteFileFromCE(CString strFileNamePPC)
{
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
BOOL bRet = CeDeleteFile(bstr);
CeRapiUninit();
return bRet;
}
分享到:
相关推荐
利用Activesync接口,通过PC直接控制wince设备的库。
rapi的用法
使用RAPI库操作移动设备
Rapi.dll&Rapidll;.dll系统文件下载,动态库文件,包含两个文件。
wget "https://dl-cdn.oray.com/hsk/linux/phddns_5.1.0_rapi_armhf.deb" -O phddns_5.1.0_rapi_armhf.deb 参考博客评论部分: https://blog.csdn.net/hjh_cos/article/details/122394976#comments_20579804
c#通过RAPI操作通过activesync连接移动设备中文件,msdn帮助地址:http://msdn.microsoft.com/zh-cn/library/ms837846.aspx#EWAA
WindowsCE,Mobile用到的RAPI和dccManSink接口. 有例子等. 有了这个可以做很多事情.可以感知WCE,WM设备的插拔等各种事件.可以操作嵌入式设备. 可以制作PC上的安装文件,把文件安装到设备上等等.
RAPI实现移动设备与PC文件的拷贝 两个工程,一个是从设备上拷出,一个是拷进设备。
同步软件同步后,Rapi实现Wince智能设备的文件传输,复制,删除.
是利用activesync接口,通过pc直接控制wince设备的库。
WinCE设备的PC端命令行远程控制工具。 将压缩包解压至任意目录中备用。 将WinCE设备通过USB连接ActiveSync,在PC端用过命令行运行相应的工具即可实现各种远程控制功能,包括dir指令,运行程序,结束进程,重启,同步...
很好的同步工具,对于开发的人来说很方便,而且对于爱好者来说也可以进入到wince的桌面,做自己想做的事情
rapi,OpenNETCF.Desktop.Communication.dll,rapi.h
OpenNETCF.Desktop 是一套提供给.NET 及C# 开发类似于ActiveSync 通讯全部功能的程序集。
The last chapter discussed Web Services, one option for connecting CF-based devices to desktop (and server) systems.
This chapter covers the Remote API, a second option for making the device-to-desktop connection for devices that are connected using ActiveSync.
wince rapi csharp file
讲述windows mobile通信,主要包括串口-红外-蓝牙-RAPI。
pb115读写CE设备(RAPI),主要是用rapi来驱动读写pda上的文件等。最近分比较少了,不好意思,不过我测试了可以用。
RAPI实现PC与PPC之间相互传输文件